PropertyNodeUtils (Groovy 5.1.0)

Package: org.codehaus.groovy.ast.tools

## [Java] Class PropertyNodeUtils

- org.codehaus.groovy.ast.tools.PropertyNodeUtils

-     public class PropertyNodeUtils
      extends Object

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public static int` | `adjustPropertyModifiersForMethod(PropertyNode node)` Fields within the AST that have no explicit visibility are deemed to be properties and represented by a PropertyNode.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### public static int adjustPropertyModifiersForMethod(PropertyNode node)

      Fields within the AST that have no explicit visibility are deemed to be properties and represented by a PropertyNode. The Groovy compiler creates accessor methods and a backing field for such property nodes. During this process, all modifiers from the property are carried over to the backing field (so a property marked as `transient` will have a `transient` backing field) but when creating the accessor methods we don't carry over modifier values which don't make sense for methods (such as `volatile` and `transient`) but other modifiers are carried over, for example `static`.

      Since:
        2.4.8
      Parameters:
        `node` - the original property node
      Returns:
        the modifiers which make sense for an accessor method