Package: org.codehaus.groovy.ast

## [Java] Class Parameter

- org.codehaus.groovy.ast.Parameter

- All Implemented Interfaces and Traits:
    Variable

      public class Parameter
      extends AnnotatedNode
      implements Variable

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

- - ### 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
    --- | --- | ---
    `` | `public Expression` | `getDefaultValue()`
    `` | `public Expression` | `getInitialExpression()`
    `` | `public int` | `getModifiers()`
    `` | `public String` | `getName()`
    `` | `public ClassNode` | `getOriginType()`
    `` | `public ClassNode` | `getType()`
    `` | `public boolean` | `hasInitialExpression()`
    `` | `public boolean` | `isClosureSharedVariable()`
    `` | `public boolean` | `isDynamicTyped()`
    `` | `public boolean` | `isImplicit()` See Also: Parameter.isImplicit
    `` | `public boolean` | `isInStaticContext()`
    `` | `public boolean` | `isReceiver()` Since: 5.0.0
    `` | `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()`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class AnnotatedNode` | `addAnnotation, addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, getGroovydoc, getInstance, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic`
    `class ASTNode` | `copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getText, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setMetaDataMap, setSourcePosition, visit`

- - ### 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 getDefaultValue()

    - #### @Override
      public Expression getInitialExpression()

    - #### @Override
      public int getModifiers()

    - #### @Override
      public String getName()

    - #### @Override
      public ClassNode getOriginType()

    - #### @Override
      public ClassNode getType()

    - #### @Override
      public boolean hasInitialExpression()

    - #### @Override
      public boolean isClosureSharedVariable()

    - #### @Override
      public boolean isDynamicTyped()

    - #### public boolean isImplicit()

      See Also:
        Parameter.isImplicit
      Since:
        5.0.0

    - #### @Override
      public boolean isInStaticContext()

    - #### public boolean isReceiver()

      Since:
        5.0.0

    - #### @Override
      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)

    - #### @Override
      public String toString()