public class Parameter extends AnnotatedNode implements Variable
Modifier and Type | Field and Description |
---|---|
static Parameter[] |
EMPTY_ARRAY |
Constructor and Description |
---|
Parameter(ClassNode type,
java.lang.String name) |
Parameter(ClassNode type,
java.lang.String name,
Expression defaultValue) |
Modifier and Type | Method and Description |
---|---|
Expression |
getInitialExpression()
expression used to initialize the variable or null of there
is no initialization.
|
int |
getModifiers() |
java.lang.String |
getName()
the name of the variable
|
ClassNode |
getOriginType()
the type before wrapping primitives type of the variable
|
ClassNode |
getType()
the type of the variable
|
boolean |
hasInitialExpression()
returns true if there is an initialization expression
|
boolean |
isClosureSharedVariable() |
boolean |
isDynamicTyped() |
boolean |
isInStaticContext()
returns true if this variable is used in a static context.
|
void |
setClosureSharedVariable(boolean inClosure) |
void |
setInitialExpression(Expression init) |
void |
setInStaticContext(boolean inStaticContext) |
void |
setModifiers(int modifiers) |
void |
setOriginType(ClassNode cn) |
void |
setType(ClassNode type) |
java.lang.String |
toString() |
addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic
copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getNodeMetaData, getText, putNodeMetaData, removeNodeMetaData, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setNodeMetaData, setSourcePosition, visit
public static final Parameter[] EMPTY_ARRAY
public Parameter(ClassNode type, java.lang.String name)
public Parameter(ClassNode type, java.lang.String name, Expression defaultValue)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getName()
Variable
public ClassNode getType()
Variable
public void setType(ClassNode type)
public boolean hasInitialExpression()
Variable
hasInitialExpression
in interface Variable
public Expression getInitialExpression()
Variable
getInitialExpression
in interface Variable
public void setInitialExpression(Expression init)
public boolean isInStaticContext()
Variable
isInStaticContext
in interface Variable
public void setInStaticContext(boolean inStaticContext)
public boolean isDynamicTyped()
isDynamicTyped
in interface Variable
public boolean isClosureSharedVariable()
isClosureSharedVariable
in interface Variable
public void setClosureSharedVariable(boolean inClosure)
setClosureSharedVariable
in interface Variable
public int getModifiers()
getModifiers
in interface Variable
public ClassNode getOriginType()
Variable
getOriginType
in interface Variable
public void setOriginType(ClassNode cn)
public void setModifiers(int modifiers)