Package lombok.ast

Examples of lombok.ast.ClassDeclaration


                if (isSuppressed(issue, declaration.astModifiers())) {
                    return true;
                }
            } else if (type == ClassDeclaration.class) {
                // Class
                ClassDeclaration declaration = (ClassDeclaration) scope;
                if (isSuppressed(issue, declaration.astModifiers())) {
                    return true;
                }
            }

            scope = scope.getParent();
View Full Code Here


                if (isSuppressed(issue, declaration.astModifiers())) {
                    return true;
                }
            } else if (type == ClassDeclaration.class) {
                // Class
                ClassDeclaration declaration = (ClassDeclaration) scope;
                if (isSuppressed(issue, declaration.astModifiers())) {
                    return true;
                }
            }

            scope = scope.getParent();
View Full Code Here

  }
 
  public Node createTypeDeclaration(String kind, Node modifiers, Node name, Node params, Node body, List<Node> addons) {
    if (kind.equals("interface")) return createInterfaceDeclaration(modifiers, name, params, body, addons);
   
    ClassDeclaration decl = new ClassDeclaration().astName(createIdentifierIfNeeded(name, currentPos())).rawBody(body);
    if (modifiers != null) decl.astModifiers(createModifiersIfNeeded(modifiers, currentPos()));
    if (params instanceof TemporaryNode.OrphanedTypeVariables) {
      TemporaryNode.OrphanedTypeVariables otv = (TemporaryNode.OrphanedTypeVariables)params;
      if (otv.variables != null) for (Node typeParameter : otv.variables) {
        if (typeParameter != null) decl.rawTypeVariables().addToEnd(typeParameter);
      }
    }
   
    if (addons != null) for (Node n : addons) {
      if (n instanceof TemporaryNode.ExtendsClause) {
        //if (!decl.implementing().isEmpty()) //TODO add error node: implements must come after extends
        //if (!decl.extending().isEmpty()) //TODO add error node: multiple extends clauses.
        List<Node> superClasses = ((TemporaryNode.ExtendsClause)n).superTypes;
        if (superClasses != null && superClasses.size() > 0) {
          //if (superClasses.size() > 1) //TODO add error node: 'extends' on class can only accept 1 type.
          decl.rawExtending(superClasses.get(0));
        }
      }
     
      if (n instanceof TemporaryNode.ImplementsClause) {
        //if (!decl.implementing().isEmpty()) //TODO add error node: multiple implements clauses.
        List<Node> interfaces = ((TemporaryNode.ImplementsClause)n).superInterfaces;
        if (interfaces != null) for (Node i : interfaces) decl.rawImplementing().addToEnd(i);
      }
    }
    return posify(decl);
  }
View Full Code Here

      flagKeyMap.put(FlagKey.CONTAINING_TYPE_NAME, name);
      flagKeyMap.put(FlagKey.BLOCKS_ARE_INITIALIZERS, FlagKey.BLOCKS_ARE_INITIALIZERS);
      flagKeyMap.put(FlagKey.SKIP_IS_DECL, FlagKey.SKIP_IS_DECL);
     
      if ((flags & (Flags.ENUM | Flags.INTERFACE)) == 0) {
        ClassDeclaration classDecl = new ClassDeclaration();
        typeDecl = classDecl;
        fillList(node.implementing, classDecl.rawImplementing(), FlagKey.TYPE_REFERENCE);
        classDecl.rawExtending(toTree(node.extending, FlagKey.TYPE_REFERENCE));
        fillList(node.typarams, classDecl.rawTypeVariables());
        NormalTypeBody body = new NormalTypeBody();
        fillList(node.defs, body.rawMembers(), flagKeyMap);
        classDecl.astBody(body);
      } else if ((flags & Flags.ANNOTATION) != 0) {
        AnnotationDeclaration annDecl = new AnnotationDeclaration();
        typeDecl = annDecl;
        NormalTypeBody body = new NormalTypeBody();
        flagKeyMap.put(FlagKey.METHODS_ARE_ANNMETHODS, FlagKey.METHODS_ARE_ANNMETHODS);
View Full Code Here

                if (isSuppressed(issue, declaration.astModifiers())) {
                    return true;
                }
            } else if (type == ClassDeclaration.class) {
                // Class
                ClassDeclaration declaration = (ClassDeclaration) scope;
                if (isSuppressed(issue, declaration.astModifiers())) {
                    return true;
                }
            }

            if (checkComments && context.isSuppressed(scope, issue)) {
View Full Code Here

TOP

Related Classes of lombok.ast.ClassDeclaration

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.