Package org.codehaus.groovy.ast.expr
Class EmptyExpression
- java.lang.Object
-
- org.codehaus.groovy.ast.ASTNode
-
- org.codehaus.groovy.ast.AnnotatedNode
-
- org.codehaus.groovy.ast.expr.Expression
-
- org.codehaus.groovy.ast.expr.EmptyExpression
-
- All Implemented Interfaces:
GroovydocHolder<AnnotatedNode>
,NodeMetaDataHandler
public class EmptyExpression extends Expression
This class is a place holder for an empty expression. Empty expression are used in closures lists like (;). During class Generation this expression should be either ignored or replace with a null value.- See Also:
EmptyStatement
-
-
Field Summary
Fields Modifier and Type Field Description static EmptyExpression
INSTANCE
-
Fields inherited from class org.codehaus.groovy.ast.expr.Expression
EMPTY_ARRAY
-
Fields inherited from interface groovy.lang.groovydoc.GroovydocHolder
DOC_COMMENT
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAnnotation(AnnotationNode value)
void
addAnnotations(java.util.List<AnnotationNode> annotations)
void
copyNodeMetaData(NodeMetaDataHandler other)
Copies all node meta data from the other node to this onejava.lang.Object
putNodeMetaData(java.lang.Object key, java.lang.Object value)
Sets the node meta data but allows overwriting values.void
removeNodeMetaData(java.lang.Object key)
Removes a node meta data entry.void
setColumnNumber(int columnNumber)
void
setDeclaringClass(ClassNode declaringClass)
void
setHasNoRealSourcePosition(boolean value)
void
setLastColumnNumber(int lastColumnNumber)
void
setLastLineNumber(int lastLineNumber)
void
setLineNumber(int lineNumber)
void
setMetaDataMap(java.util.Map<?,?> metaDataMap)
void
setNodeMetaData(java.lang.Object key, java.lang.Object value)
Sets the node meta data.void
setSourcePosition(ASTNode node)
Sets the source position using another ASTNode.void
setSynthetic(boolean synthetic)
sets this node as a node added by the compiler.void
setType(ClassNode t)
Expression
transformExpression(ExpressionTransformer transformer)
Return a copy of the expression calling the transformer on any nested expressionsvoid
visit(GroovyCodeVisitor visitor)
-
Methods inherited from class org.codehaus.groovy.ast.expr.Expression
getType, transformExpressions, transformExpressions
-
Methods inherited from class org.codehaus.groovy.ast.AnnotatedNode
getAnnotations, getAnnotations, getDeclaringClass, getGroovydoc, getInstance, hasNoRealSourcePosition, isSynthetic
-
Methods inherited from class org.codehaus.groovy.ast.ASTNode
copyNodeMetaData, equals, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getText, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.codehaus.groovy.ast.NodeMetaDataHandler
getNodeMetaData, getNodeMetaData
-
-
-
-
Field Detail
-
INSTANCE
public static final EmptyExpression INSTANCE
-
-
Method Detail
-
transformExpression
public Expression transformExpression(ExpressionTransformer transformer)
Description copied from class:Expression
Return a copy of the expression calling the transformer on any nested expressions- Specified by:
transformExpression
in classExpression
-
visit
public void visit(GroovyCodeVisitor visitor)
-
setType
public void setType(ClassNode t)
- Overrides:
setType
in classExpression
-
addAnnotation
public void addAnnotation(AnnotationNode value)
- Overrides:
addAnnotation
in classAnnotatedNode
-
addAnnotations
public void addAnnotations(java.util.List<AnnotationNode> annotations)
- Overrides:
addAnnotations
in classAnnotatedNode
-
setSynthetic
public void setSynthetic(boolean synthetic)
Description copied from class:AnnotatedNode
sets this node as a node added by the compiler. NOTE: This method has nothing to do with the synthetic flag for fields, methods or classes.- Overrides:
setSynthetic
in classAnnotatedNode
- Parameters:
synthetic
- - if true this node is marked as added by the compiler
-
setDeclaringClass
public void setDeclaringClass(ClassNode declaringClass)
- Overrides:
setDeclaringClass
in classAnnotatedNode
- Parameters:
declaringClass
- - The declaringClass to set.
-
setHasNoRealSourcePosition
public void setHasNoRealSourcePosition(boolean value)
- Overrides:
setHasNoRealSourcePosition
in classAnnotatedNode
-
setLineNumber
public void setLineNumber(int lineNumber)
- Overrides:
setLineNumber
in classASTNode
-
setColumnNumber
public void setColumnNumber(int columnNumber)
- Overrides:
setColumnNumber
in classASTNode
-
setLastLineNumber
public void setLastLineNumber(int lastLineNumber)
- Overrides:
setLastLineNumber
in classASTNode
-
setLastColumnNumber
public void setLastColumnNumber(int lastColumnNumber)
- Overrides:
setLastColumnNumber
in classASTNode
-
setSourcePosition
public void setSourcePosition(ASTNode node)
Description copied from class:ASTNode
Sets the source position using another ASTNode. The sourcePosition consists of a line/column pair for the start and a line/column pair for the end of the expression or statement- Overrides:
setSourcePosition
in classASTNode
- Parameters:
node
- - the node used to configure the position information
-
copyNodeMetaData
public void copyNodeMetaData(NodeMetaDataHandler other)
Description copied from interface:NodeMetaDataHandler
Copies all node meta data from the other node to this one- Parameters:
other
- - the other node
-
setNodeMetaData
public void setNodeMetaData(java.lang.Object key, java.lang.Object value)
Description copied from interface:NodeMetaDataHandler
Sets the node meta data.- Parameters:
key
- - the meta data keyvalue
- - the meta data value
-
putNodeMetaData
public java.lang.Object putNodeMetaData(java.lang.Object key, java.lang.Object value)
Description copied from interface:NodeMetaDataHandler
Sets the node meta data but allows overwriting values.- Parameters:
key
- - the meta data keyvalue
- - the meta data value- Returns:
- the old node meta data value for this key
-
removeNodeMetaData
public void removeNodeMetaData(java.lang.Object key)
Description copied from interface:NodeMetaDataHandler
Removes a node meta data entry.- Parameters:
key
- - the meta data key
-
setMetaDataMap
public void setMetaDataMap(java.util.Map<?,?> metaDataMap)
- Specified by:
setMetaDataMap
in interfaceNodeMetaDataHandler
- Overrides:
setMetaDataMap
in classASTNode
-
-