Package japa.parser.ast.expr

Examples of japa.parser.ast.expr.ObjectCreationExpr


            final Expression init = fd.getVariables().get(0).getInit();

            // Resolve imports (ROO-1505)
            if (init instanceof ObjectCreationExpr) {
                final ObjectCreationExpr ocr = (ObjectCreationExpr) init;
                final JavaType typeToImport = JavaParserUtils.getJavaTypeNow(
                        compilationUnitServices, ocr.getType(), null);
                final NameExpr nameExpr = JavaParserUtils.importTypeIfRequired(
                        compilationUnitServices.getEnclosingTypeName(),
                        compilationUnitServices.getImports(), typeToImport);
                final ClassOrInterfaceType classOrInterfaceType = JavaParserUtils
                        .getClassOrInterfaceType(nameExpr);
                ocr.setType(classOrInterfaceType);

                if (typeToImport.getParameters().size() > 0) {
                    final List<Type> initTypeArgs = new ArrayList<Type>();
                    finalType.setTypeArgs(initTypeArgs);
                    for (final JavaType parameter : typeToImport
View Full Code Here


        return Boolean.TRUE;
    }

    public Boolean visit(ObjectCreationExpr n1, Node arg) {
        ObjectCreationExpr n2 = (ObjectCreationExpr) arg;

        if (!nodeEquals(n1.getScope(), n2.getScope())) {
            return Boolean.FALSE;
        }

        if (!nodeEquals(n1.getType(), n2.getType())) {
            return Boolean.FALSE;
        }

        if (!nodesEquals(n1.getAnonymousClassBody(), n2.getAnonymousClassBody())) {
            return Boolean.FALSE;
        }

        if (!nodesEquals(n1.getArgs(), n2.getArgs())) {
            return Boolean.FALSE;
        }

        if (!nodesEquals(n1.getTypeArgs(), n2.getTypeArgs())) {
            return Boolean.FALSE;
        }

        return Boolean.TRUE;
    }
View Full Code Here

                            if (jj_2_30(2)) {
                                anonymousBody = ClassOrInterfaceBody(false);
                            } else {
                                ;
                            }
                            ret = new ObjectCreationExpr(line, column, token.endLine, token.endColumn, scope, (ClassOrInterfaceType) type, typeArgs, args, anonymousBody);
                            break;
                        default:
                            jj_la1[99] = jj_gen;
                            jj_consume_token(-1);
                            throw new ParseException();
View Full Code Here

    List<Type> typeArgs = visit(_n.getTypeArgs(), _arg);
    List<Expression> args = visit(_n.getArgs(), _arg);
    List<BodyDeclaration> anonymousBody = visit(_n.getAnonymousClassBody(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    ObjectCreationExpr r = new ObjectCreationExpr(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
        scope, type_, typeArgs, args, anonymousBody
    );
    r.setComment(comment);
    return r;
  }
View Full Code Here

    return Boolean.TRUE;
  }

  @Override public Boolean visit(final ObjectCreationExpr n1, final Node arg) {
    final ObjectCreationExpr n2 = (ObjectCreationExpr) arg;

    if (!nodeEquals(n1.getScope(), n2.getScope())) {
      return Boolean.FALSE;
    }

    if (!nodeEquals(n1.getType(), n2.getType())) {
      return Boolean.FALSE;
    }

    if (!nodesEquals(n1.getAnonymousClassBody(), n2.getAnonymousClassBody())) {
      return Boolean.FALSE;
    }

    if (!nodesEquals(n1.getArgs(), n2.getArgs())) {
      return Boolean.FALSE;
    }

    if (!nodesEquals(n1.getTypeArgs(), n2.getTypeArgs())) {
      return Boolean.FALSE;
    }

    return Boolean.TRUE;
  }
View Full Code Here

TOP

Related Classes of japa.parser.ast.expr.ObjectCreationExpr

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.