Examples of JCVariableDecl


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

       
        List<JCTree> result = builder.build();
       
        if (Decl.isLocal(def)) {
            // Inner method
            JCVariableDecl call = at(def).VarDef(
                    make().Modifiers(FINAL),
                    naming.getSyntheticInstanceName(model),
                    naming.makeSyntheticClassname(model),
                    makeSyntheticInstance(model));
            result = result.append(call);
View Full Code Here

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

                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);
                result = result.prepend(localDecl);
            }else{
                // not captured, we can define the var after the class
                JCVariableDecl localDecl = makeLocalIdentityInstance(name, objectClassBuilder.getClassName(), false);
                result = result.append(localDecl);
            }
           
        } else if (Decl.withinClassOrInterface(model)) {
            boolean visible = Decl.isCaptured(model);
View Full Code Here

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

    if (decls == null || decls.isEmpty()) {
      VariableDefinition def = new VariableDefinition();
      return createDeclaration ? new VariableDeclaration().astDefinition(def) : def;
    }
   
    JCVariableDecl first = decls.get(0);
    int startPosFirst = first.pos;
   
    JCExpression baseType = first.vartype;
    while (baseType instanceof JCArrayTypeTree) {
      // if written as int[] a[], b; then the base Type is *NOT* a's type, but a's type with any number of JCATT's dewrapped.
View Full Code Here

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

        fillList(node.implementing, enumDecl.rawImplementing(), FlagKey.TYPE_REFERENCE);
        java.util.List<JCTree> defs = new ArrayList<JCTree>();
       
        for (JCTree def : node.defs) {
          if (def instanceof JCVariableDecl) {
            JCVariableDecl vd = (JCVariableDecl) def;
            if (vd.mods != null && (vd.mods.flags & ENUM_CONSTANT_FLAGS) == ENUM_CONSTANT_FLAGS) {
              // This is an enum constant, not a field of the enum class.
              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) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.