Package lombok.ast

Examples of lombok.ast.InterfaceDeclaration


    if (tail != null) for (Node n : tail) if (n != null) result.superInterfaces.add(n);
    return posify(result);
  }
 
  public Node createInterfaceDeclaration(Node modifiers, Node name, Node params, Node body, List<Node> addons) {
    InterfaceDeclaration decl = new InterfaceDeclaration().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.extending().isEmpty()) //TODO add error node: multiple extends clauses.
        List<Node> superClasses = ((TemporaryNode.ExtendsClause)n).superTypes;
        if (superClasses != null) for (Node superClass : superClasses) if (superClass != null) decl.rawExtending().addToEnd(superClass);
      }
     
      //if (n instanceof TemporaryNode.ImplementsClause) //TODO add error node: implements not allowed here.
    }
   
View Full Code Here


        NormalTypeBody body = new NormalTypeBody();
        flagKeyMap.put(FlagKey.METHODS_ARE_ANNMETHODS, FlagKey.METHODS_ARE_ANNMETHODS);
        fillList(node.defs, body.rawMembers(), flagKeyMap);
        annDecl.astBody(body);
      } else if ((flags & Flags.INTERFACE) != 0) {
        InterfaceDeclaration itfDecl = new InterfaceDeclaration();
        typeDecl = itfDecl;
        fillList(node.typarams, itfDecl.rawTypeVariables());
        fillList(node.implementing, itfDecl.rawExtending(), FlagKey.TYPE_REFERENCE);
        NormalTypeBody body = new NormalTypeBody();
        fillList(node.defs, body.rawMembers(), flagKeyMap);
        itfDecl.astBody(body);
      } else if ((flags & Flags.ENUM) != 0) {
        EnumDeclaration enumDecl = new EnumDeclaration();
        typeDecl = enumDecl;
        EnumTypeBody body = new EnumTypeBody();
        fillList(node.implementing, enumDecl.rawImplementing(), FlagKey.TYPE_REFERENCE);
View Full Code Here

TOP

Related Classes of lombok.ast.InterfaceDeclaration

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.