Package org.codehaus.groovy.ast

# Interface NodeMetaDataHandler

All Known Implementing Classes:
  `AbstractGinqExpression`, `AnnotatedNode`, `AnnotationConstantExpression`, `AnnotationNode`, `ArgumentListExpression`, `ArrayExpression`, `AssertStatement`, `ASTNode`, `AttributeExpression`, `BinaryExpression`, `BitwiseNegationExpression`, `BlockStatement`, `BooleanExpression`, `BreakStatement`, `BytecodeExpression`, `BytecodeSequence`, `CaseStatement`, `CastExpression`, `CatchStatement`, `ClassExpression`, `ClassNode`, `ClosureExpression`, `ClosureListExpression`, `CompareIdentityExpression`, `CompareToNullExpression`, `CompileUnit`, `ConstantExpression`, `ConstructorCallExpression`, `ConstructorNode`, `ContinueStatement`, `DataSourceExpression`, `DeclarationExpression`, `DecompiledClassNode`, `DoWhileStatement`, `ElvisOperatorExpression`, `EmptyExpression`, `EmptyStatement`, `EnumConstantClassNode`, `Expression`, `ExpressionAsVariableSlot`, `ExpressionStatement`, `ExtensionMethodNode`, `FieldExpression`, `FieldNode`, `FilterExpression`, `ForStatement`, `FromExpression`, `GenericsType`, `GinqExpression`, `GroupExpression`, `GStringExpression`, `HavingExpression`, `IfStatement`, `ImportNode`, `InnerClassNode`, `InterfaceHelperClassNode`, `JoinExpression`, `LambdaExpression`, `LimitExpression`, `ListExpression`, `ListOfExpressionsExpression`, `MapEntryExpression`, `MapExpression`, `MethodCallExpression`, `MethodNode`, `MethodPointerExpression`, `MethodReferenceExpression`, `MixinNode`, `ModifierNode`, `ModuleNode`, `NamedArgumentListExpression`, `NotExpression`, `OnExpression`, `OrderExpression`, `PackageNode`, `Parameter`, `PostfixExpression`, `PrefixExpression`, `ProcessExpression`, `PropertyExpression`, `PropertyNode`, `RangeExpression`, `RecordComponentNode`, `ReturnStatement`, `SelectExpression`, `ShutdownExpression`, `SpreadExpression`, `SpreadMapExpression`, `Statement`, `StaticMethodCallExpression`, `SwitchStatement`, `SynchronizedStatement`, `TemporaryVariableExpression`, `TernaryExpression`, `ThrowStatement`, `TryCatchStatement`, `TupleExpression`, `UnaryMinusExpression`, `UnaryPlusExpression`, `VariableExpression`, `VariableSlotLoader`, `WhereExpression`, `WhileStatement`, `WideningCategories.LowestUpperBoundClassNode`

public interface NodeMetaDataHandler
An interface to mark a node being able to handle metadata.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default void`
  `copyNodeMetaData(NodeMetaDataHandler other)`
  Copies all node meta data from the other node to this one
  `Map<?,?>`
  `getMetaDataMap()`
  `default Map<?,?>`
  `getNodeMetaData()`
  Returns an unmodifiable view of the current node metadata.
  `default <T> T`
  `getNodeMetaData(Object key)`
  Gets the node meta data.
  `default <T> T`
  `getNodeMetaData(Object key, Function<?,? extends T> valFn)`
  Gets the node meta data.
  `default Object`
  `putNodeMetaData(Object key, Object value)`
  Sets the node meta data but allows overwriting values.
  `default void`
  `removeNodeMetaData(Object key)`
  Removes a node meta data entry.
  `void`
  `setMetaDataMap(Map<?,?> metaDataMap)`
  `default void`
  `setNodeMetaData(Object key, Object value)`
  Sets the node meta data.

- ## Method Details

  - ### getNodeMetaData

    default <T> T getNodeMetaData(Object key)
    Gets the node meta data.
    Parameters:
      `key` - the meta data key
    Returns:
      the node meta data value for this key

  - ### getNodeMetaData

    default <T> T getNodeMetaData(Object key, Function<?,? extends T> valFn)
    Gets the node meta data.
    Parameters:
      `key` - the meta data key
      `valFn` - the meta data value supplier
    Returns:
      the node meta data value for this key

  - ### copyNodeMetaData

    default void copyNodeMetaData(NodeMetaDataHandler other)
    Copies all node meta data from the other node to this one
    Parameters:
      `other` - the other node

  - ### setNodeMetaData

    default void setNodeMetaData(Object key, Object value)
    Sets the node meta data.
    Parameters:
      `key` - the meta data key
      `value` - the meta data value
    Throws:
      `GroovyBugError` - if key is null or there is already meta data under that key

  - ### putNodeMetaData

    default Object putNodeMetaData(Object key, Object value)
    Sets the node meta data but allows overwriting values.
    Parameters:
      `key` - the meta data key
      `value` - the meta data value
    Returns:
      the old node meta data value for this key
    Throws:
      `GroovyBugError` - if key is null

  - ### removeNodeMetaData

    default void removeNodeMetaData(Object key)
    Removes a node meta data entry.
    Parameters:
      `key` - the meta data key
    Throws:
      `GroovyBugError` - if the key is null

  - ### getNodeMetaData

    default Map<?,?> getNodeMetaData()
    Returns an unmodifiable view of the current node metadata.
    Returns:
      the node metadata. Always not null.

  - ### getMetaDataMap

    Map<?,?> getMetaDataMap()

  - ### setMetaDataMap

    void setMetaDataMap(Map<?,?> metaDataMap)