Package lombok.ast

Examples of lombok.ast.AnnotationMethodDeclaration


    if (modifiers != null) decl.astModifiers(createModifiersIfNeeded(modifiers, currentPos()));
    return posify(decl);
  }
 
  public Node createAnnotationMethodDeclaration(Node modifiers, Node typeReference, Node name, List<org.parboiled.Node<Node>> dims, Node defaultValue) {
    AnnotationMethodDeclaration decl = new AnnotationMethodDeclaration()
        .astMethodName(createIdentifierIfNeeded(name, currentPos())).rawDefaultValue(defaultValue);
    if (modifiers != null) decl.astModifiers(createModifiersIfNeeded(modifiers, currentPos()));
    int extraDims = dims == null ? 0 : dims.size();
    Node returnType = typeReference;
    if (extraDims > 0 && returnType instanceof TypeReference) {
      ((TypeReference)returnType).astArrayDimensions(((TypeReference)returnType).astArrayDimensions() + extraDims);
    }
    decl.rawReturnTypeReference(returnType);
    return posify(decl);
  }
View Full Code Here


        set(node, cd);
        return;
      }
     
      if (hasFlag(FlagKey.METHODS_ARE_ANNMETHODS)) {
        AnnotationMethodDeclaration md = new AnnotationMethodDeclaration();
        md.astModifiers((Modifiers) toTree(node.getModifiers()));
        md.astMethodName(setPos(node, new Identifier().astValue(name)));
        md.rawReturnTypeReference(toTree(node.getReturnType(), FlagKey.TYPE_REFERENCE));
        md.rawDefaultValue(toTree(node.getDefaultValue()));
        addJavadoc(md, node.mods);
        set(node, md);
        return;
      }
     
      MethodDeclaration md = new MethodDeclaration();
      md.rawBody(toTree(node.getBody()));
      md.astModifiers((Modifiers) toTree(node.getModifiers()));
      md.astMethodName(setPos(node, new Identifier().astValue(name)));
      fillList(node.getThrows(), md.rawThrownTypeReferences(), FlagKey.TYPE_REFERENCE);
      fillList(node.getTypeParameters(), md.rawTypeVariables());
      fillList(node.getParameters(), md.rawParameters(), FlagKey.NO_VARDECL_FOLDING, FlagKey.VARDEF_IS_DEFINITION);
      md.rawReturnTypeReference(toTree(node.getReturnType(), FlagKey.TYPE_REFERENCE));
      addJavadoc(md, node.mods);
      set(node, md);
    }
View Full Code Here

TOP

Related Classes of lombok.ast.AnnotationMethodDeclaration

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.