Package com.sun.tools.javac.tree.JCTree

Examples of com.sun.tools.javac.tree.JCTree.JCNewClass


            .build();
       
        if (makeLocalInstance) {
            if(model.isSelfCaptured()){
                // if it's captured we need to box it and define the var before the class, so it can access it
                JCNewClass newInstance = makeNewClass(objectClassBuilder.getClassName(), false, null);
                JCFieldAccess setter = naming.makeSelect(Naming.getLocalValueName(model), Naming.getSetterName(model));
                JCStatement assign = make().Exec(make().Assign(setter, newInstance));
                result = result.prepend(assign);

                JCVariableDecl localDecl = makeVariableBoxDecl(null, model);
View Full Code Here


        at(null);
        if(model.isAlias())
            model = model.getExtendedTypeDeclaration();
        JCExpression nameId = makeJavaType(model.getType(), JT_RAW);
        List<JCExpression> arguments = makeBottomReifiedTypeParameters(model.getTypeParameters());
        JCNewClass expr = make().NewClass(null, null, nameId, arguments, null);
        return makeMainMethod(model, expr);
    }
View Full Code Here

              EnumConstant ec = new EnumConstant();
              setPos(def, ec);
              ec.astName(new Identifier().astValue(vd.getName().toString()));
              fillList(vd.mods.annotations, ec.rawAnnotations());
              if (vd.init instanceof JCNewClass) {
                JCNewClass init = (JCNewClass) vd.init;
                fillList(init.getArguments(), ec.rawArguments());
                if (init.getClassBody() != null) {
                  NormalTypeBody constantBody = setPos(init, new NormalTypeBody());
                  fillList(init.getClassBody().getMembers(), constantBody.rawMembers());
                  ec.astBody(constantBody);
                }
                setConversionPositionInfo(ec, "newClass", getPosition(init));
              }
              body.astConstants().addToEnd(ec);
View Full Code Here

TOP

Related Classes of com.sun.tools.javac.tree.JCTree.JCNewClass

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.