Package org.codehaus.groovy.ast

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

      public class AnnotatedNode
      extends ASTNode
      implements GroovydocHolder<AnnotatedNode>

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

- - ### Field Summary

    - ### Fields inherited from interface groovy.lang.groovydoc.GroovydocHolder

      `DOC_COMMENT`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AnnotatedNode()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addAnnotation​(AnnotationNode annotation)` |
    `void` | `addAnnotations​(List<AnnotationNode> annotations)` |
    `List<AnnotationNode>` | `getAnnotations()` |
    `List<AnnotationNode>` | `getAnnotations​(ClassNode type)` |
    `ClassNode` | `getDeclaringClass()` |
    `Groovydoc` | `getGroovydoc()` | Get the groovydoc
    `AnnotatedNode` | `getInstance()` | Get GroovydocHolder instance
    `boolean` | `hasNoRealSourcePosition()` | Returns true for default constructors added by the compiler.
    `boolean` | `isSynthetic()` | Indicates if this node was added by the compiler.
    `void` | `setDeclaringClass​(ClassNode declaringClass)` |
    `void` | `setHasNoRealSourcePosition​(boolean hasNoRealSourcePosition)` |
    `void` | `setSynthetic​(boolean synthetic)` | Sets this node as a node added by the compiler.

    - ### Methods inherited from class org.codehaus.groovy.ast.ASTNode

      `copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getText, hashCode, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setMetaDataMap, setSourcePosition, visit`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.codehaus.groovy.ast.NodeMetaDataHandler

      `copyNodeMetaData, getNodeMetaData, getNodeMetaData, getNodeMetaData, putNodeMetaData, removeNodeMetaData, setNodeMetaData`

- - ### Constructor Detail

    - #### AnnotatedNode

          public AnnotatedNode()

  - ### Method Detail

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