[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
Type Params | Return Type | Name and description |
---|---|---|
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
Methods inherited from class | Name |
---|---|
class ASTNode | copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getText, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setMetaDataMap, setSourcePosition, visit |
Method Detail
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.
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/3.0.7/html/gapi/org/codehaus/groovy/ast/AnnotatedNode.html