Top Description Fields Constructors Methods
org.codehaus.groovy.ast.decompiled

pack-priv Class LazyFieldNode

extends FieldNode
implements LazyInitializable
Class Inheritance
All Implemented Interfaces
org.apache.groovy.util.concurrent.LazyInitializable
Imports
groovy.lang.groovydoc.Groovydoc, org.apache.groovy.util.concurrent.LazyInitializable, org.codehaus.groovy.ast.ASTNode, .AnnotatedNode, .AnnotationNode, .ClassNode, .FieldNode, .GroovyCodeVisitor, .NodeMetaDataHandler, org.codehaus.groovy.ast.expr.Expression, java.util.List, .Map, java.util.function.Function, .Supplier

Represents lazy field node, which will be initialized only when accessed
Since
2.5.9

Field Summary

Modifier and TypeField and Description
private FieldNode
private final Supplier<FieldNode>
private volatile boolean
private final String

Constructor Summary

AccessConstructor and Description
public
LazyFieldNode(Supplier<FieldNode> fieldNodeSupplier, String name)

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
copyNodeMetaData(ASTNode
- the other node
other
)

Overrides org.codehaus.groovy.ast.ASTNode.copyNodeMetaData.

Copies all node meta data from the other node to this one
public void
copyNodeMetaData(NodeMetaDataHandler
the other node
other
)

Overrides default org.codehaus.groovy.ast.NodeMetaDataHandler.copyNodeMetaData.

Copies all node meta data from the other node to this one
public void
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides org.codehaus.groovy.ast.FieldNode.equals.

Indicates whether some other object is "equal to" this one.
public List<AnnotationNode>
public List<AnnotationNode>
public int
public ClassNode
public Groovydoc
public Expression
getInitialExpression()

Overrides org.codehaus.groovy.ast.FieldNode.getInitialExpression.

Implements org.codehaus.groovy.ast.Variable.getInitialExpression.

expression used to initialize the variable or null of there is no initialization.
public Expression
public AnnotatedNode
public int
public int
public int
public Map<?, ?>
public int
public String
public <T> T
getNodeMetaData(Object
the meta data key
key
)

Overrides default org.codehaus.groovy.ast.NodeMetaDataHandler.getNodeMetaData.

Gets the node meta data.
public <T> T
getNodeMetaData(Object
the meta data key
key
,
Function<?, ? extends T>
the meta data value supplier
valFn
)

Overrides default org.codehaus.groovy.ast.NodeMetaDataHandler.getNodeMetaData.

Gets the node meta data.
public Map<?, ?>
getNodeMetaData()

Overrides default org.codehaus.groovy.ast.NodeMetaDataHandler.getNodeMetaData.

Returns an unmodifiable view of the current node metadata.
public ClassNode
getOriginType()

Overrides org.codehaus.groovy.ast.FieldNode.getOriginType.

Implements org.codehaus.groovy.ast.Variable.getOriginType.

the type before wrapping primitives type of the variable
public ClassNode
public String
public ClassNode
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public boolean
public boolean
hasNoRealSourcePosition()

Overrides org.codehaus.groovy.ast.AnnotatedNode.hasNoRealSourcePosition.

Returns true for default constructors added by the compiler.
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
isInStaticContext()

Overrides org.codehaus.groovy.ast.FieldNode.isInStaticContext.

Implements org.codehaus.groovy.ast.Variable.isInStaticContext.

returns true if this variable is used in a static context.
public boolean
public boolean
public boolean
public boolean
public boolean
isSynthetic()

Overrides org.codehaus.groovy.ast.AnnotatedNode.isSynthetic.

Indicates if this node was added by the compiler.
public boolean
public Object
putNodeMetaData(Object
the meta data key
key
,
Object
the meta data value
value
)

Overrides default org.codehaus.groovy.ast.NodeMetaDataHandler.putNodeMetaData.

Sets the node meta data but allows overwriting values.
public void
removeNodeMetaData(Object
the meta data key
key
)

Overrides default org.codehaus.groovy.ast.NodeMetaDataHandler.removeNodeMetaData.

Removes a node meta data entry.
public void
public void
public void
public void
public void
public void
public void
setInitialized(boolean
initialized
initialized
)

Implements org.apache.groovy.util.concurrent.LazyInitializable.setInitialized.

Mark the object initialized.
public void
public void
public void
public void
public void
public void
public void
setNodeMetaData(Object
the meta data key
key
,
Object
the meta data value
value
)

Overrides default org.codehaus.groovy.ast.NodeMetaDataHandler.setNodeMetaData.

Sets the node meta data.
public void
public void
public void
setSourcePosition(ASTNode
- the node used to configure the position information
node
)

Overrides org.codehaus.groovy.ast.ASTNode.setSourcePosition.

Sets the source position using another ASTNode.
public void
setSynthetic(boolean synthetic)

Overrides org.codehaus.groovy.ast.AnnotatedNode.setSynthetic.

Sets this node as a node added by the compiler.
public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public void
Inherited from org.codehaus.groovy.ast.FieldNode:
newStatic

Field Detail

delegateback to summary
private FieldNode delegate
fieldNodeSupplierback to summary
private final Supplier<FieldNode> fieldNodeSupplier
initializedback to summary
private volatile boolean initialized
nameback to summary
private final String name

Hides org.codehaus.groovy.ast.FieldNode.name.

Constructor Detail

LazyFieldNodeback to summary
public LazyFieldNode(Supplier<FieldNode> fieldNodeSupplier, String name)

Method Detail

addAnnotationback to summary
public void addAnnotation(AnnotationNode annotation)

Overrides org.codehaus.groovy.ast.AnnotatedNode.addAnnotation.

Annotations
@Override
addAnnotationsback to summary
public void addAnnotations(List<AnnotationNode> annotations)

Overrides org.codehaus.groovy.ast.AnnotatedNode.addAnnotations.

Annotations
@Override
copyNodeMetaDataback to summary
public void copyNodeMetaData(ASTNode other)

Overrides org.codehaus.groovy.ast.ASTNode.copyNodeMetaData.

Doc from org.codehaus.groovy.ast.ASTNode.copyNodeMetaData.

Copies all node meta data from the other node to this one

Parameters
other:ASTNode

- the other node

Annotations
@Override
copyNodeMetaDataback to summary
public void copyNodeMetaData(NodeMetaDataHandler other)

Overrides default org.codehaus.groovy.ast.NodeMetaDataHandler.copyNodeMetaData.

Doc from org.codehaus.groovy.ast.NodeMetaDataHandler.copyNodeMetaData.

Copies all node meta data from the other node to this one

Parameters
other:NodeMetaDataHandler

the other node

Annotations
@Override
doInitback to summary
public void doInit()

Implements org.apache.groovy.util.concurrent.LazyInitializable.doInit.

Doc from org.apache.groovy.util.concurrent.LazyInitializable.doInit.

do initialization

Annotations
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides org.codehaus.groovy.ast.FieldNode.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getAnnotationsback to summary
public List<AnnotationNode> getAnnotations()

Overrides org.codehaus.groovy.ast.AnnotatedNode.getAnnotations.

Annotations
@Override
getAnnotationsback to summary
public List<AnnotationNode> getAnnotations(ClassNode type)

Overrides org.codehaus.groovy.ast.AnnotatedNode.getAnnotations.

Annotations
@Override
getColumnNumberback to summary
public int getColumnNumber()

Overrides org.codehaus.groovy.ast.ASTNode.getColumnNumber.

Annotations
@Override
getDeclaringClassback to summary
public ClassNode getDeclaringClass()

Overrides org.codehaus.groovy.ast.AnnotatedNode.getDeclaringClass.

Annotations
@Override
getGroovydocback to summary
public Groovydoc getGroovydoc()

Overrides org.codehaus.groovy.ast.AnnotatedNode.getGroovydoc.

Implements groovy.lang.groovydoc.GroovydocHolder.getGroovydoc.

Doc from groovy.lang.groovydoc.GroovydocHolder.getGroovydoc.

Get the groovydoc

Returns:Groovydoc

the groovydoc

Annotations
@Override
getInitialExpressionback to summary
public Expression getInitialExpression()

Overrides org.codehaus.groovy.ast.FieldNode.getInitialExpression.

Implements org.codehaus.groovy.ast.Variable.getInitialExpression.

Doc from org.codehaus.groovy.ast.Variable.getInitialExpression.

expression used to initialize the variable or null of there is no initialization.

Annotations
@Override
getInitialValueExpressionback to summary
public Expression getInitialValueExpression()

Overrides org.codehaus.groovy.ast.FieldNode.getInitialValueExpression.

Annotations
@Override
getInstanceback to summary
public AnnotatedNode getInstance()

Overrides org.codehaus.groovy.ast.AnnotatedNode.getInstance.

Implements groovy.lang.groovydoc.GroovydocHolder.getInstance.

Doc from groovy.lang.groovydoc.GroovydocHolder.getInstance.

Get GroovydocHolder instance

Returns:AnnotatedNode

GroovydocHolder instance

Annotations
@Override
getLastColumnNumberback to summary
public int getLastColumnNumber()

Overrides org.codehaus.groovy.ast.ASTNode.getLastColumnNumber.

Annotations
@Override
getLastLineNumberback to summary
public int getLastLineNumber()

Overrides org.codehaus.groovy.ast.ASTNode.getLastLineNumber.

Annotations
@Override
getLineNumberback to summary
public int getLineNumber()

Overrides org.codehaus.groovy.ast.ASTNode.getLineNumber.

Annotations
@Override
getMetaDataMapback to summary
public Map<?, ?> getMetaDataMap()

Overrides org.codehaus.groovy.ast.ASTNode.getMetaDataMap.

Implements org.codehaus.groovy.ast.NodeMetaDataHandler.getMetaDataMap.

Annotations
@Override
getModifiersback to summary
public int getModifiers()

Overrides org.codehaus.groovy.ast.FieldNode.getModifiers.

Implements org.codehaus.groovy.ast.Variable.getModifiers.

Annotations
@Override
getNameback to summary
public String getName()

Overrides org.codehaus.groovy.ast.FieldNode.getName.

Implements org.codehaus.groovy.ast.Variable.getName.

Doc from org.codehaus.groovy.ast.Variable.getName.

the name of the variable

Annotations
@Override
getNodeMetaDataback to summary
public <T> T getNodeMetaData(Object key)

Overrides default org.codehaus.groovy.ast.NodeMetaDataHandler.getNodeMetaData.

Doc from org.codehaus.groovy.ast.NodeMetaDataHandler.getNodeMetaData.

Gets the node meta data.

Parameters
key:Object

the meta data key

Returns:T

the node meta data value for this key

Annotations
@Override
getNodeMetaDataback to summary
public <T> T getNodeMetaData(Object key, Function<?, ? extends T> valFn)

Overrides default org.codehaus.groovy.ast.NodeMetaDataHandler.getNodeMetaData.

Doc from org.codehaus.groovy.ast.NodeMetaDataHandler.getNodeMetaData.

Gets the node meta data.

Parameters
key:Object

the meta data key

valFn:Function<?, ? extends T>

the meta data value supplier

Returns:T

the node meta data value for this key

Annotations
@Override
getNodeMetaDataback to summary
public Map<?, ?> getNodeMetaData()

Overrides default org.codehaus.groovy.ast.NodeMetaDataHandler.getNodeMetaData.

Doc from org.codehaus.groovy.ast.NodeMetaDataHandler.getNodeMetaData.

Returns an unmodifiable view of the current node metadata.

Returns:Map<?, ?>

the node metadata. Always not null.

Annotations
@Override
getOriginTypeback to summary
public ClassNode getOriginType()

Overrides org.codehaus.groovy.ast.FieldNode.getOriginType.

Implements org.codehaus.groovy.ast.Variable.getOriginType.

Doc from org.codehaus.groovy.ast.Variable.getOriginType.

the type before wrapping primitives type of the variable

Annotations
@Override
getOwnerback to summary
public ClassNode getOwner()

Overrides org.codehaus.groovy.ast.FieldNode.getOwner.

Annotations
@Override
getTextback to summary
public String getText()

Overrides org.codehaus.groovy.ast.ASTNode.getText.

Annotations
@Override
getTypeback to summary
public ClassNode getType()

Overrides org.codehaus.groovy.ast.FieldNode.getType.

Implements org.codehaus.groovy.ast.Variable.getType.

Doc from org.codehaus.groovy.ast.Variable.getType.

the type of the variable

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
hasInitialExpressionback to summary
public boolean hasInitialExpression()

Overrides org.codehaus.groovy.ast.FieldNode.hasInitialExpression.

Implements org.codehaus.groovy.ast.Variable.hasInitialExpression.

Doc from org.codehaus.groovy.ast.Variable.hasInitialExpression.

returns true if there is an initialization expression

Annotations
@Override
hasNoRealSourcePositionback to summary
public boolean hasNoRealSourcePosition()

Overrides org.codehaus.groovy.ast.AnnotatedNode.hasNoRealSourcePosition.

Doc from org.codehaus.groovy.ast.AnnotatedNode.hasNoRealSourcePosition.

Returns true for default constructors added by the compiler.

See GROOVY-4161

Annotations
@Override
isClosureSharedVariableback to summary
public boolean isClosureSharedVariable()

Overrides org.codehaus.groovy.ast.FieldNode.isClosureSharedVariable.

Implements org.codehaus.groovy.ast.Variable.isClosureSharedVariable.

Deprecated

Annotations
@Override
@Deprecated
isDynamicTypedback to summary
public boolean isDynamicTyped()

Overrides org.codehaus.groovy.ast.FieldNode.isDynamicTyped.

Implements org.codehaus.groovy.ast.Variable.isDynamicTyped.

Annotations
@Override
isEnumback to summary
public boolean isEnum()

Overrides org.codehaus.groovy.ast.FieldNode.isEnum.

Returns:boolean

Doc from org.codehaus.groovy.ast.FieldNode.isEnum.

true if the field is an enum

Annotations
@Override
isFinalback to summary
public boolean isFinal()

Overrides org.codehaus.groovy.ast.FieldNode.isFinal.

Returns:boolean

Doc from org.codehaus.groovy.ast.FieldNode.isFinal.

true if the field is final

Annotations
@Override
isHolderback to summary
public boolean isHolder()

Overrides org.codehaus.groovy.ast.FieldNode.isHolder.

Annotations
@Override
isInitializedback to summary
public boolean isInitialized()

Implements org.apache.groovy.util.concurrent.LazyInitializable.isInitialized.

Doc from org.apache.groovy.util.concurrent.LazyInitializable.isInitialized.

Check if the object is initialized.

Returns:boolean

the check result

Annotations
@Override
isInStaticContextback to summary
public boolean isInStaticContext()

Overrides org.codehaus.groovy.ast.FieldNode.isInStaticContext.

Implements org.codehaus.groovy.ast.Variable.isInStaticContext.

Doc from org.codehaus.groovy.ast.Variable.isInStaticContext.

returns true if this variable is used in a static context. A static context is any static initializer block, when this variable is declared as static or when this variable is used in a static method

Annotations
@Override
isPrivateback to summary
public boolean isPrivate()

Overrides org.codehaus.groovy.ast.FieldNode.isPrivate.

Returns:boolean

Doc from org.codehaus.groovy.ast.FieldNode.isPrivate.

true if the field is private

Annotations
@Override
isProtectedback to summary
public boolean isProtected()

Overrides org.codehaus.groovy.ast.FieldNode.isProtected.

Returns:boolean

Doc from org.codehaus.groovy.ast.FieldNode.isProtected.

true if the field is protected

Annotations
@Override
isPublicback to summary
public boolean isPublic()

Overrides org.codehaus.groovy.ast.FieldNode.isPublic.

Returns:boolean

Doc from org.codehaus.groovy.ast.FieldNode.isPublic.

true if the field is public

Annotations
@Override
isStaticback to summary
public boolean isStatic()

Overrides org.codehaus.groovy.ast.FieldNode.isStatic.

Returns:boolean

Doc from org.codehaus.groovy.ast.FieldNode.isStatic.

true if the field is static

Annotations
@Override
isSyntheticback to summary
public boolean isSynthetic()

Overrides org.codehaus.groovy.ast.AnnotatedNode.isSynthetic.

Doc from org.codehaus.groovy.ast.AnnotatedNode.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.

Annotations
@Override
isVolatileback to summary
public boolean isVolatile()

Overrides org.codehaus.groovy.ast.FieldNode.isVolatile.

Returns:boolean

Doc from org.codehaus.groovy.ast.FieldNode.isVolatile.

true if the field is volatile

Annotations
@Override
putNodeMetaDataback to summary
public Object putNodeMetaData(Object key, Object value)

Overrides default org.codehaus.groovy.ast.NodeMetaDataHandler.putNodeMetaData.

Doc from org.codehaus.groovy.ast.NodeMetaDataHandler.putNodeMetaData.

Sets the node meta data but allows overwriting values.

Parameters
key:Object

the meta data key

value:Object

the meta data value

Returns:Object

the old node meta data value for this key

Annotations
@Override
removeNodeMetaDataback to summary
public void removeNodeMetaData(Object key)

Overrides default org.codehaus.groovy.ast.NodeMetaDataHandler.removeNodeMetaData.

Doc from org.codehaus.groovy.ast.NodeMetaDataHandler.removeNodeMetaData.

Removes a node meta data entry.

Parameters
key:Object

the meta data key

Annotations
@Override
renameback to summary
public void rename(String name)

Overrides org.codehaus.groovy.ast.FieldNode.rename.

Annotations
@Override
setClosureSharedVariableback to summary
public void setClosureSharedVariable(boolean inClosure)

Overrides org.codehaus.groovy.ast.FieldNode.setClosureSharedVariable.

Implements org.codehaus.groovy.ast.Variable.setClosureSharedVariable.

Deprecated

Annotations
@Override
@Deprecated
setColumnNumberback to summary
public void setColumnNumber(int columnNumber)

Overrides org.codehaus.groovy.ast.ASTNode.setColumnNumber.

Annotations
@Override
setDeclaringClassback to summary
public void setDeclaringClass(ClassNode declaringClass)

Overrides org.codehaus.groovy.ast.AnnotatedNode.setDeclaringClass.

Annotations
@Override
setHasNoRealSourcePositionback to summary
public void setHasNoRealSourcePosition(boolean hasNoRealSourcePosition)

Overrides org.codehaus.groovy.ast.AnnotatedNode.setHasNoRealSourcePosition.

Annotations
@Override
setHolderback to summary
public void setHolder(boolean holder)

Overrides org.codehaus.groovy.ast.FieldNode.setHolder.

Annotations
@Override
setInitializedback to summary
public void setInitialized(boolean initialized)

Implements org.apache.groovy.util.concurrent.LazyInitializable.setInitialized.

Doc from org.apache.groovy.util.concurrent.LazyInitializable.setInitialized.

Mark the object initialized.

Parameters
initialized:boolean

initialized

Annotations
@Override
setInitialValueExpressionback to summary
public void setInitialValueExpression(Expression initialValueExpression)

Overrides org.codehaus.groovy.ast.FieldNode.setInitialValueExpression.

Annotations
@Override
setLastColumnNumberback to summary
public void setLastColumnNumber(int lastColumnNumber)

Overrides org.codehaus.groovy.ast.ASTNode.setLastColumnNumber.

Annotations
@Override
setLastLineNumberback to summary
public void setLastLineNumber(int lastLineNumber)

Overrides org.codehaus.groovy.ast.ASTNode.setLastLineNumber.

Annotations
@Override
setLineNumberback to summary
public void setLineNumber(int lineNumber)

Overrides org.codehaus.groovy.ast.ASTNode.setLineNumber.

Annotations
@Override
setMetaDataMapback to summary
public void setMetaDataMap(Map<?, ?> metaDataMap)

Overrides org.codehaus.groovy.ast.ASTNode.setMetaDataMap.

Implements org.codehaus.groovy.ast.NodeMetaDataHandler.setMetaDataMap.

Annotations
@Override
setModifiersback to summary
public void setModifiers(int modifiers)

Overrides org.codehaus.groovy.ast.FieldNode.setModifiers.

Annotations
@Override
setNodeMetaDataback to summary
public void setNodeMetaData(Object key, Object value)

Overrides default org.codehaus.groovy.ast.NodeMetaDataHandler.setNodeMetaData.

Doc from org.codehaus.groovy.ast.NodeMetaDataHandler.setNodeMetaData.

Sets the node meta data.

Parameters
key:Object

the meta data key

value:Object

the meta data value

Annotations
@Override
setOriginTypeback to summary
public void setOriginType(ClassNode cn)

Overrides org.codehaus.groovy.ast.FieldNode.setOriginType.

Annotations
@Override
setOwnerback to summary
public void setOwner(ClassNode owner)

Overrides org.codehaus.groovy.ast.FieldNode.setOwner.

Parameters
owner:ClassNode

Doc from org.codehaus.groovy.ast.FieldNode.setOwner.

The owner to set.

Annotations
@Override
setSourcePositionback to summary
public void setSourcePosition(ASTNode node)

Overrides org.codehaus.groovy.ast.ASTNode.setSourcePosition.

Doc from org.codehaus.groovy.ast.ASTNode.setSourcePosition.

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

Parameters
node:ASTNode

- the node used to configure the position information

Annotations
@Override
setSyntheticback to summary
public void setSynthetic(boolean synthetic)

Overrides org.codehaus.groovy.ast.AnnotatedNode.setSynthetic.

Doc from org.codehaus.groovy.ast.AnnotatedNode.setSynthetic.

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.

Annotations
@Override
setTypeback to summary
public void setType(ClassNode type)

Overrides org.codehaus.groovy.ast.FieldNode.setType.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
visitback to summary
public void visit(GroovyCodeVisitor visitor)

Overrides org.codehaus.groovy.ast.ASTNode.visit.

Annotations
@Override