AnnotatedNode (Groovy 5.0.0)

Package: org.codehaus.groovy.ast

## [Java] Class AnnotatedNode

- org.codehaus.groovy.ast.AnnotatedNode

- All Implemented Interfaces and Traits:
    GroovydocHolder

      public class AnnotatedNode
      extends ASTNode
      implements GroovydocHolder

  Base class for any AST node which is capable of being annotated

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public AnnotationNode` | `addAnnotation(ClassNode type)`
    `` | `public void` | `addAnnotation(AnnotationNode annotation)`
    `` | `public void` | `addAnnotations(List<AnnotationNode> annotations)`
    `` | `public List<AnnotationNode>` | `getAnnotations()`
    `` | `public List<AnnotationNode>` | `getAnnotations(ClassNode type)`
    `` | `public ClassNode` | `getDeclaringClass()`
    `` | `public Groovydoc` | `getGroovydoc()`
    `` | `public AnnotatedNode` | `getInstance()`
    `` | `public boolean` | `hasNoRealSourcePosition()` Returns true for default constructors added by the compiler.
    `` | `public boolean` | `isSynthetic()` Indicates if this node was added by the compiler.
    `` | `public void` | `setDeclaringClass(ClassNode declaringClass)`
    `` | `public void` | `setHasNoRealSourcePosition(boolean hasNoRealSourcePosition)`
    `` | `public void` | `setSynthetic(boolean synthetic)` Sets this node as a node added by the compiler.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class ASTNode` | `copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getText, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setMetaDataMap, setSourcePosition, visit`

- - ### Method Detail

    - #### public AnnotationNode addAnnotation(ClassNode type)

    - #### public void addAnnotation(AnnotationNode annotation)

    - #### public void addAnnotations(List<AnnotationNode> annotations)

    - #### public List<AnnotationNode> getAnnotations()

    - #### public List<AnnotationNode> getAnnotations(ClassNode type)

    - #### public ClassNode getDeclaringClass()

    - #### @Override
      public Groovydoc getGroovydoc()

    - #### @Override
      public AnnotatedNode getInstance()

    - #### public boolean hasNoRealSourcePosition()

      Returns true for default constructors added by the compiler.

      See GROOVY-4161

    - #### 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.

    - #### public void setDeclaringClass(ClassNode declaringClass)

    - #### public void setHasNoRealSourcePosition(boolean hasNoRealSourcePosition)

    - #### 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.