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 EmptyExpressionINSTANCE-
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 voidaddAnnotation(AnnotationNode value)voidaddAnnotations(List<AnnotationNode> annotations)voidcopyNodeMetaData(NodeMetaDataHandler other)Copies all node meta data from the other node to this oneObjectputNodeMetaData(Object key, Object value)Sets the node meta data but allows overwriting values.voidremoveNodeMetaData(Object key)Removes a node meta data entry.voidsetColumnNumber(int columnNumber)voidsetDeclaringClass(ClassNode declaringClass)voidsetHasNoRealSourcePosition(boolean value)voidsetLastColumnNumber(int lastColumnNumber)voidsetLastLineNumber(int lastLineNumber)voidsetLineNumber(int lineNumber)voidsetMetaDataMap(Map<?,?> metaDataMap)voidsetNodeMetaData(Object key, Object value)Sets the node meta data.voidsetSourcePosition(ASTNode node)Sets the source position using another ASTNode.voidsetSynthetic(boolean synthetic)sets this node as a node added by the compiler.voidsetType(ClassNode t)ExpressiontransformExpression(ExpressionTransformer transformer)Return a copy of the expression calling the transformer on any nested expressionsvoidvisit(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:ExpressionReturn a copy of the expression calling the transformer on any nested expressions- Specified by:
transformExpressionin classExpression
-
visit
public void visit(GroovyCodeVisitor visitor)
-
setType
public void setType(ClassNode t)
- Overrides:
setTypein classExpression
-
addAnnotation
public void addAnnotation(AnnotationNode value)
- Overrides:
addAnnotationin classAnnotatedNode
-
addAnnotations
public void addAnnotations(List<AnnotationNode> annotations)
- Overrides:
addAnnotationsin classAnnotatedNode
-
setSynthetic
public void setSynthetic(boolean synthetic)
Description copied from class:AnnotatedNodesets 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:
setSyntheticin classAnnotatedNode- Parameters:
synthetic- - if true this node is marked as added by the compiler
-
setDeclaringClass
public void setDeclaringClass(ClassNode declaringClass)
- Overrides:
setDeclaringClassin classAnnotatedNode- Parameters:
declaringClass- - The declaringClass to set.
-
setHasNoRealSourcePosition
public void setHasNoRealSourcePosition(boolean value)
- Overrides:
setHasNoRealSourcePositionin classAnnotatedNode
-
setLineNumber
public void setLineNumber(int lineNumber)
- Overrides:
setLineNumberin classASTNode
-
setColumnNumber
public void setColumnNumber(int columnNumber)
- Overrides:
setColumnNumberin classASTNode
-
setLastLineNumber
public void setLastLineNumber(int lastLineNumber)
- Overrides:
setLastLineNumberin classASTNode
-
setLastColumnNumber
public void setLastColumnNumber(int lastColumnNumber)
- Overrides:
setLastColumnNumberin classASTNode
-
setSourcePosition
public void setSourcePosition(ASTNode node)
Description copied from class:ASTNodeSets 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:
setSourcePositionin classASTNode- Parameters:
node- - the node used to configure the position information
-
copyNodeMetaData
public void copyNodeMetaData(NodeMetaDataHandler other)
Description copied from interface:NodeMetaDataHandlerCopies all node meta data from the other node to this one- Parameters:
other- - the other node
-
setNodeMetaData
public void setNodeMetaData(Object key, Object value)
Description copied from interface:NodeMetaDataHandlerSets the node meta data.- Parameters:
key- - the meta data keyvalue- - the meta data value
-
putNodeMetaData
public Object putNodeMetaData(Object key, Object value)
Description copied from interface:NodeMetaDataHandlerSets 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(Object key)
Description copied from interface:NodeMetaDataHandlerRemoves a node meta data entry.- Parameters:
key- - the meta data key
-
setMetaDataMap
public void setMetaDataMap(Map<?,?> metaDataMap)
- Specified by:
setMetaDataMapin interfaceNodeMetaDataHandler- Overrides:
setMetaDataMapin classASTNode
-
-