[Java] Class Parameter

  • org.codehaus.groovy.ast.Parameter
All Implemented Interfaces and Traits:
Variable
public class Parameter
extends AnnotatedNode

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

Authors:
James Strachan

Field Summary

Fields
Modifiers Name Description
static Parameter[] EMPTY_ARRAY

Constructor Summary

Constructors
Constructor and description
Parameter (ClassNode type, String name)
Parameter (ClassNode type, String name, Expression defaultValue)

Methods Summary

Methods
Type Params Return Type Name and description
Expression getInitialExpression()
@return the default value expression for this parameter or null if no default value is specified
int getModifiers()
String getName()
ClassNode getOriginType()
ClassNode getType()
boolean hasInitialExpression()
boolean isClosureSharedVariable()
boolean isDynamicTyped()
boolean isInStaticContext()
void setClosureSharedVariable(boolean inClosure)
void setInStaticContext(boolean inStaticContext)
void setInitialExpression(Expression init)
void setModifiers(int modifiers)
void setOriginType(ClassNode cn)
void setType(ClassNode type)
String toString()

Inherited Methods Summary

Inherited Methods
Methods inherited from class Name
class AnnotatedNode addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic
class ASTNode copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getNodeMetaData, getNodeMetaData, getText, putNodeMetaData, removeNodeMetaData, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setNodeMetaData, setSourcePosition, visit
class Object wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll

Field Detail

public static final Parameter[] EMPTY_ARRAY

Constructor Detail

public Parameter(ClassNode type, String name)

public Parameter(ClassNode type, String name, Expression defaultValue)

Method Detail

public Expression getInitialExpression()

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

public int getModifiers()

public String getName()

public ClassNode getOriginType()

public ClassNode getType()

public boolean hasInitialExpression()

public boolean isClosureSharedVariable()

public boolean isDynamicTyped()

public boolean isInStaticContext()

public void setClosureSharedVariable(boolean inClosure)

public void setInStaticContext(boolean inStaticContext)

public void setInitialExpression(Expression init)

public void setModifiers(int modifiers)

public void setOriginType(ClassNode cn)

public void setType(ClassNode type)

public String toString()

© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/2.4.21/html/gapi/org/codehaus/groovy/ast/Parameter.html