Class ASTNode

java.lang.Object
org.codehaus.groovy.ast.ASTNode
All Implemented Interfaces:
NodeMetaDataHandler
Direct Known Subclasses:
AnnotatedNode, AnnotationNode, GenericsType, ModifierNode, ModuleNode, Statement

public class ASTNode
extends Object
implements NodeMetaDataHandler
Base class for any AST node. This class supports basic information used in all nodes of the AST:
  • line and column number information. Usually a node represents a certain area in a text file determined by a starting position and an ending position. For nodes that do not represent this, this information will be -1. A node can also be configured in its line/col information using another node through setSourcePosition(otherNode).
  • every node can store meta data. A phase operation or transform can use this to transport arbitrary information to another phase operation or transform. The only requirement is that the other phase operation or transform runs after the part storing the information. If the information transport is done it is strongly recommended to remove that meta data.
  • a text representation of this node trough getText(). This was in the past used for assertion messages. Since the usage of power asserts this method will not be called for this purpose anymore and might be removed in future versions of Groovy