Package: org.codehaus.groovy.ast

## [Java] Class PropertyNode

- org.codehaus.groovy.ast.PropertyNode

- All Implemented Interfaces and Traits:
    Variable

      public class PropertyNode
      extends AnnotatedNode
      implements Variable

  Represents a property (member variable, a getter and setter)

- - ### Constructor Summary

    Constructors
    Constructor and description
    `PropertyNode(String name, int modifiers, ClassNode type, ClassNode owner, Expression initialValueExpression, Statement getterBlock, Statement setterBlock)`
    `PropertyNode(FieldNode field, int modifiers, Statement getterBlock, Statement setterBlock)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public FieldNode` | `getField()`
    `` | `public Statement` | `getGetterBlock()`
    `` | `public String` | `getGetterName()` Since: 4.0.0
    `` | `public String` | `getGetterNameOrDefault()` If an explicit getterName has been set, return that, otherwise return the default name for the property.
    `` | `public Expression` | `getInitialExpression()`
    `` | `public int` | `getModifiers()`
    `` | `public String` | `getName()`
    `` | `public ClassNode` | `getOriginType()`
    `` | `public Statement` | `getSetterBlock()`
    `` | `public String` | `getSetterName()` Since: 4.0.0
    `` | `public String` | `getSetterNameOrDefault()` Since: 4.0.0
    `` | `public ClassNode` | `getType()`
    `` | `public boolean` | `hasInitialExpression()`
    `` | `public boolean` | `isDynamicTyped()`
    `` | `public boolean` | `isInStaticContext()`
    `` | `public void` | `setField(FieldNode field)`
    `` | `public void` | `setGetterBlock(Statement getterBlock)`
    `` | `public void` | `setGetterName(String getterName)` Since: 4.0.0
    `` | `public void` | `setModifiers(int modifiers)`
    `` | `public void` | `setSetterBlock(Statement setterBlock)`
    `` | `public void` | `setSetterName(String setterName)` Since: 4.0.0
    `` | `public void` | `setType(ClassNode t)`

  - ### 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`

- - ### Constructor Detail

    - #### public PropertyNode(String name, int modifiers, ClassNode type, ClassNode owner, Expression initialValueExpression, Statement getterBlock, Statement setterBlock)

    - #### public PropertyNode(FieldNode field, int modifiers, Statement getterBlock, Statement setterBlock)

  - ### Method Detail

    - #### public FieldNode getField()

    - #### public Statement getGetterBlock()

    - #### public String getGetterName()

      Since:
        4.0.0

    - #### public String getGetterNameOrDefault()

      If an explicit getterName has been set, return that, otherwise return the default name for the property. For a property `foo`, the default name is `getFoo` except for a boolean property where `isFoo` is the default if no `getFoo` method exists in the declaring class.

      Since:
        4.0.0

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

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

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

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

    - #### public Statement getSetterBlock()

    - #### public String getSetterName()

      Since:
        4.0.0

    - #### public String getSetterNameOrDefault()

      Since:
        4.0.0

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

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

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

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

    - #### public void setField(FieldNode field)

    - #### public void setGetterBlock(Statement getterBlock)

    - #### public void setGetterName(String getterName)

      Since:
        4.0.0

    - #### public void setModifiers(int modifiers)

    - #### public void setSetterBlock(Statement setterBlock)

    - #### public void setSetterName(String setterName)

      Since:
        4.0.0

    - #### public void setType(ClassNode t)