Package lombok.ast

Examples of lombok.ast.ConstructorDeclaration


                    return true;
                }
            } else if (type == ConstructorDeclaration.class) {
                // Constructor
                // Look for annotations on the method
                ConstructorDeclaration declaration = (ConstructorDeclaration) scope;
                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


                    return true;
                }
            } else if (type == ConstructorDeclaration.class) {
                // Constructor
                // Look for annotations on the method
                ConstructorDeclaration declaration = (ConstructorDeclaration) scope;
                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 createConstructorDeclaration(Node modifiers, Node typeParameters, Node name,
      Node params, Node throwsHead, List<Node> throwsTail, Node body) {
   
    ConstructorDeclaration decl = new ConstructorDeclaration().astTypeName(
        createIdentifierIfNeeded(name, currentPos())).rawBody(body);
    if (modifiers != null) decl.astModifiers(createModifiersIfNeeded(modifiers, currentPos()));
    if (typeParameters instanceof TemporaryNode.OrphanedTypeVariables) {
      for (Node typeParameter : ((TemporaryNode.OrphanedTypeVariables)typeParameters).variables) {
        decl.rawTypeVariables().addToEnd(typeParameter);
      }
    }
   
    if (params instanceof TemporaryNode.MethodParameters) {
      for (Node param : ((TemporaryNode.MethodParameters)params).parameters) {
        decl.rawParameters().addToEnd(param);
      }
    } else DanglingNodes.addDanglingNode(decl, params);
   
    if (throwsHead != null) decl.rawThrownTypeReferences().addToEnd(throwsHead);
    if (throwsTail != null) for (Node n : throwsTail) if (n != null) decl.rawThrownTypeReferences().addToEnd(n);
    return posify(decl);
  }
View Full Code Here

  public void varargsOnlyLegalOnMethods(VariableDefinition node) {
    if (!node.astVarargs()) return;
    if (node.getParent() == null) return;
   
    MethodDeclaration md = node.upIfParameterToMethodDeclaration();
    ConstructorDeclaration cd = node.upIfParameterToConstructorDeclaration();
    Node last;
   
    if (md != null) last = md.astParameters().last();
    else if (cd != null) last = cd.astParameters().last();
    else last = null;
   
    if (node != last) {
      node.addMessage(error(VARIABLEDEFINITION_VARARGS_NOT_LEGAL_HERE, "Varargs are only legal on the last parameter of a constructor or method."));
    }
View Full Code Here

    }
   
    @Override public void visitMethodDef(JCMethodDecl node) {
      String name = node.getName() == null ? null : node.getName().toString();
      if ("<init>".equals(name)) {
        ConstructorDeclaration cd = new ConstructorDeclaration();
        cd.astModifiers((Modifiers) toTree(node.getModifiers()));
        cd.rawBody(toTree(node.getBody()));
        fillList(node.getThrows(), cd.rawThrownTypeReferences(), FlagKey.TYPE_REFERENCE);
        fillList(node.getTypeParameters(), cd.rawTypeVariables());
        fillList(node.getParameters(), cd.rawParameters(), FlagKey.NO_VARDECL_FOLDING, FlagKey.VARDEF_IS_DEFINITION);
        String typeName = (String) getFlag(FlagKey.CONTAINING_TYPE_NAME);
        cd.astTypeName(setPos(node, new Identifier().astValue(typeName)));
        addJavadoc(cd, node.mods);
        set(node, cd);
        return;
      }
     
View Full Code Here

                    return true;
                }
            } else if (type == ConstructorDeclaration.class) {
                // Constructor
                // Look for annotations on the method
                ConstructorDeclaration declaration = (ConstructorDeclaration) scope;
                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.ConstructorDeclaration

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.