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

public Class Parameter

extends AnnotatedNode
implements Variable
Class Inheritance
All Implemented Interfaces
org.codehaus.groovy.ast.Variable
Imports
org.codehaus.groovy.ast.expr.Expression

Represents a parameter on a constructor or method call. The type name is optional - it defaults to java.lang.Object if unknown.

Field Summary

Modifier and TypeField and Description
private boolean
private Expression
private boolean
public static final Parameter[]
private boolean
private boolean
private int
private final String
private ClassNode
private ClassNode

Constructor Summary

AccessConstructor and Description
public
public
Parameter(ClassNode type, String name, Expression defaultValue)

Method Summary

Modifier and TypeMethod and Description
public Expression
public Expression

Returns:

the default value expression for this parameter or null if no default value is specified
getInitialExpression
()

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

expression used to initialize the variable or null of there is no initialization.
public int
public String
getName()

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

the name of the variable
public ClassNode
getOriginType()

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

the type before wrapping primitives type of the variable
public ClassNode
getType()

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

the type of the variable
public boolean
hasInitialExpression()

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

returns true if there is an initialization expression
public boolean
public boolean
public boolean
isInStaticContext()

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

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

public void
setModifiers(int modifiers)

public void
public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.codehaus.groovy.ast.AnnotatedNode:
addAnnotationaddAnnotationsgetAnnotationsgetAnnotationsgetDeclaringClassgetGroovydocgetInstancehasNoRealSourcePositionisSyntheticsetDeclaringClasssetHasNoRealSourcePositionsetSynthetic

Field Detail

closureShareback to summary
private boolean closureShare
defaultValueback to summary
private Expression defaultValue
dynamicTypedback to summary
private boolean dynamicTyped
EMPTY_ARRAYback to summary
public static final Parameter[] EMPTY_ARRAY
hasDefaultValueback to summary
private boolean hasDefaultValue
inStaticContextback to summary
private boolean inStaticContext
modifiersback to summary
private int modifiers
nameback to summary
private final String name
originTypeback to summary
private ClassNode originType
typeback to summary
private ClassNode type

Constructor Detail

Parameterback to summary
public Parameter(ClassNode type, String name)
Parameterback to summary
public Parameter(ClassNode type, String name, Expression defaultValue)

Method Detail

getDefaultValueback to summary
public Expression getDefaultValue()
getInitialExpressionback to summary
public Expression 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.

Returns:Expression

the default value expression for this parameter or null if no default value is specified

getModifiersback to summary
public int getModifiers()

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

getNameback to summary
public String getName()

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

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

the name of the variable

getOriginTypeback to summary
public ClassNode 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

getTypeback to summary
public ClassNode getType()

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

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

the type of the variable

hasInitialExpressionback to summary
public boolean hasInitialExpression()

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

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

returns true if there is an initialization expression

isClosureSharedVariableback to summary
public boolean isClosureSharedVariable()

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

isDynamicTypedback to summary
public boolean isDynamicTyped()

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

isInStaticContextback to summary
public boolean 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

setClosureSharedVariableback to summary
public void setClosureSharedVariable(boolean inClosure)

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

setInitialExpressionback to summary
public void setInitialExpression(Expression init)
setInStaticContextback to summary
public void setInStaticContext(boolean inStaticContext)
setModifiersback to summary
public void setModifiers(int modifiers)
setOriginTypeback to summary
public void setOriginType(ClassNode cn)
setTypeback to summary
public void setType(ClassNode type)
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.