Package: org.apache.groovy.ast.tools

## [Java] Class AnnotatedNodeUtils

- org.apache.groovy.ast.tools.AnnotatedNodeUtils

-     public class AnnotatedNodeUtils
      extends Object

  Utility class for working with AnnotatedNodes

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public static boolean` | `deemedInternal(AnnotatedNode node)` Checks whether an AST node is deemed internal, either by name convention (contains `$`) or by being annotated with @Internal.
    `` | `public static boolean` | `hasAnnotation(AnnotatedNode node, ClassNode annotation)` Checks whether the supplied node carries the given annotation.
    `` | `public static boolean` | `isGenerated(AnnotatedNode node)` Checks whether the supplied node has been marked as generated.
    `` | `public static boolean` | `isInternal(AnnotatedNode node)` Checks whether a node is annotated with @Internal.
    `<T extends AnnotatedNode>` | `public static T` | `markAsGenerated(ClassNode containingClass, T nodeToMark)` Marks the supplied node with @Generated when generation metadata is available.
    `<T extends AnnotatedNode>` | `public static T` | `markAsGenerated(ClassNode containingClass, T nodeToMark, boolean skipChecks)` Marks the supplied node with @Generated.
    `<T extends AnnotatedNode>` | `public static T` | `markAsInternal(T nodeToMark)` Marks a node with the @Internal annotation.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### public static boolean deemedInternal(AnnotatedNode node)

      Checks whether an AST node is deemed internal, either by name convention (contains `$`) or by being annotated with @Internal.

      Since:
        6.0.0

    - #### public static boolean hasAnnotation(AnnotatedNode node, ClassNode annotation)

      Checks whether the supplied node carries the given annotation.

      Parameters:
        `node` - the node to inspect
        `annotation` - the annotation type to look for
      Returns:
        `true` if the node has at least one matching annotation

    - #### public static boolean isGenerated(AnnotatedNode node)

      Checks whether the supplied node has been marked as generated.

      Parameters:
        `node` - the node to inspect
      Returns:
        `true` if the node carries @Generated

    - #### public static boolean isInternal(AnnotatedNode node)

      Checks whether a node is annotated with @Internal.

      Since:
        6.0.0

    - #### <T extends AnnotatedNode> public static T markAsGenerated(ClassNode containingClass, T nodeToMark)

      Marks the supplied node with @Generated when generation metadata is available.

      Parameters:
        `containingClass` - the class currently receiving generated members
        `nodeToMark` - the node to annotate
      Returns:
        the supplied node

    - #### <T extends AnnotatedNode> public static T markAsGenerated(ClassNode containingClass, T nodeToMark, boolean skipChecks)

      Marks the supplied node with @Generated.

      Parameters:
        `containingClass` - the class currently receiving generated members
        `nodeToMark` - the node to annotate
        `skipChecks` - whether to skip the usual source-context checks
      Returns:
        the supplied node

    - #### <T extends AnnotatedNode> public static T markAsInternal(T nodeToMark)

      Marks a node with the @Internal annotation.

      Since:
        6.0.0