Class AnnotatedNode

java.lang.Object
org.codehaus.groovy.ast.ASTNode
org.codehaus.groovy.ast.AnnotatedNode
All Implemented Interfaces:
GroovydocHolder<AnnotatedNode>, NodeMetaDataHandler
Direct Known Subclasses:
ClassNode, Expression, FieldNode, ImportNode, MethodNode, PackageNode, Parameter, PropertyNode, RecordComponentNode

public class AnnotatedNode extends ASTNode implements GroovydocHolder<AnnotatedNode>
Base class for any AST node which is capable of being annotated
  • Constructor Details

    • AnnotatedNode

      public AnnotatedNode()
  • Method Details

    • getAnnotations

      public List<AnnotationNode> getAnnotations()
    • getAnnotations

      public List<AnnotationNode> getAnnotations(ClassNode type)
    • addAnnotation

      public void addAnnotation(AnnotationNode annotation)
    • addAnnotations

      public void addAnnotations(List<AnnotationNode> annotations)
    • getDeclaringClass

      public ClassNode getDeclaringClass()
    • setDeclaringClass

      public void setDeclaringClass(ClassNode declaringClass)
    • getGroovydoc

      public Groovydoc getGroovydoc()
      Description copied from interface: GroovydocHolder
      Get the groovydoc
      Specified by:
      getGroovydoc in interface GroovydocHolder<AnnotatedNode>
      Returns:
      the groovydoc
    • getInstance

      public AnnotatedNode getInstance()
      Description copied from interface: GroovydocHolder
      Get GroovydocHolder instance
      Specified by:
      getInstance in interface GroovydocHolder<AnnotatedNode>
      Returns:
      GroovydocHolder instance
    • hasNoRealSourcePosition

      public boolean hasNoRealSourcePosition()
      Returns true for default constructors added by the compiler.

      See GROOVY-4161

    • setHasNoRealSourcePosition

      public void setHasNoRealSourcePosition(boolean hasNoRealSourcePosition)
    • isSynthetic

      public boolean isSynthetic()
      Indicates if this node was added by the compiler.

      Note: This method has nothing to do with the synthetic flag for classes, fields, methods or properties.

    • setSynthetic

      public void setSynthetic(boolean synthetic)
      Sets this node as a node added by the compiler.

      Note: This method has nothing to do with the synthetic flag for classes, fields, methods or properties.