Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.Expression


          if (exp instanceof MemberValuePair) {
            MemberValuePair mvp = (MemberValuePair) exp;
            String paramName = mvp.getName()
                .getFullyQualifiedName();
            if (paramName.startsWith("serialized")) {
              Expression val = mvp.getValue();
              if (val instanceof StringLiteral) {
                StringLiteral sl = (StringLiteral) val;
                if (sl.getLiteralValue().equals("true")) {
                  return true;
                }
View Full Code Here


            ASTNode aNode = a
                .findNode((org.eclipse.jdt.core.dom.CompilationUnit) node);
            if (aNode instanceof NormalAnnotation) {
              NormalAnnotation na = (NormalAnnotation) aNode;
              Expression exp = getAnnotationElement(na, "members");
              parseAnnotationListElement(elems, annotationName,
                  nameProp, colProp, exp);
            }
          }
        }
      } catch (JavaModelException e) {
        e.printStackTrace();
      }
    } else {
      try {
        ias = f.getAnnotations();
        String annotationSetName = "AttributeOverrides";
        String annotationName = "AttributeOverride";
        String nameProp = "name";
        String colProp = "column";

        for (IAnnotation ia : ias) {
          if (ia.getElementName().equals(annotationSetName)) {
            if (ia instanceof Annotation) {
              Annotation a = (Annotation) ia;

              ICompilationUnit ic = a.getCompilationUnit();
              CompilationUnit cu = (CompilationUnit) ic;

              ASTParser astParser = ASTParser.newParser(AST.JLS3);
              astParser.setSource(cu.getContents());
              ASTNode node = astParser
                  .createAST(new NullProgressMonitor());

              ASTNode aNode = a
                  .findNode((org.eclipse.jdt.core.dom.CompilationUnit) node);

              if (aNode instanceof SingleMemberAnnotation) {
                SingleMemberAnnotation sma = (SingleMemberAnnotation) aNode;
                Expression val = sma.getValue();
                parseAnnotationListElement(elems,
                    annotationName, nameProp, colProp, val);
              }
            }
          } else if (ia.getElementName().equals(annotationName)) {
View Full Code Here

    if (e instanceof NormalAnnotation) {
      NormalAnnotation na = (NormalAnnotation) e;
      String naName = na.getTypeName().getFullyQualifiedName();
      if (naName.equals(annotationName)) {

        Expression nameEXP = getAnnotationElement(na, nameProp);
        Expression columnExp = getAnnotationElement(na, colProp);

        while (!(columnExp instanceof StringLiteral)) {
          columnExp = getAnnotationElement(columnExp, nameProp);
        }
        if (nameEXP instanceof StringLiteral
View Full Code Here

        elementType.accept(this);

        for (Iterator it = node.dimensions().iterator(); it.hasNext();) {
            _output("[");

            Expression e = (Expression) it.next();
            e.accept(this);
            _output("]");
            dims--;
        }

        // add empty "[]" for each extra array dimension
View Full Code Here

        _openBrace();

        for (Iterator it = node.expressions().iterator(); it.hasNext();) {
            _output(_indent);

            Expression e = (Expression) it.next();
            e.accept(this);

            if (it.hasNext()) {
                _output(",");
            }
View Full Code Here

        node.getType().accept(this);

        _output("(");

        for (Iterator it = node.arguments().iterator(); it.hasNext();) {
            Expression e = (Expression) it.next();
            e.accept(this);

            if (it.hasNext()) {
                _output(", ");
            }
        }
View Full Code Here

        }

        _output("this(");

        for (Iterator it = node.arguments().iterator(); it.hasNext();) {
            Expression e = (Expression) it.next();
            e.accept(this);

            if (it.hasNext()) {
                _output(", ");
            }
        }
View Full Code Here

        if (!node.arguments().isEmpty()) {
            _output("(");

            for (Iterator it = node.arguments().iterator(); it.hasNext();) {
                Expression e = (Expression) it.next();
                e.accept(this);

                if (it.hasNext()) {
                    _output(", ");
                }
            }
View Full Code Here

    public boolean visit(ForStatement node) {
        _output(_indent);
        _output("for (");

        for (Iterator it = node.initializers().iterator(); it.hasNext();) {
            Expression e = (Expression) it.next();
            e.accept(this);

            if (it.hasNext()) {
                _output(", ");
            }
        }

        _output("; ");

        if (node.getExpression() != null) {
            node.getExpression().accept(this);
        }

        _output("; ");

        for (Iterator it = node.updaters().iterator(); it.hasNext();) {
            Expression e = (Expression) it.next();
            e.accept(this);

            if (it.hasNext()) {
                _output(", ");
            }
        }
View Full Code Here

        node.getRightOperand().accept(this);

        for (Iterator it = node.extendedOperands().iterator(); it.hasNext();) {
            _output(node.getOperator().toString());

            Expression e = (Expression) it.next();
            e.accept(this);
        }

        return false;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.Expression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.