Package: org.apache.groovy.ast.tools

## [Java] Class ConstructorNodeUtils

- org.apache.groovy.ast.tools.ConstructorNodeUtils

-     public class ConstructorNodeUtils
      extends Object

  Utility class for working with ConstructorNodes

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public static Statement` | `checkPropNamesS(VariableExpression namedArgs, boolean pojo, List<PropertyNode> props)` Creates a statement that validates named-argument keys against the supplied properties.
    `` | `public static ConstructorCallExpression` | `getFirstIfSpecialConstructorCall(Statement code)` Return the first statement from the constructor code if it is a call to super or this, otherwise null.

  - ### Inherited Methods Summary

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

- - ### Method Detail

    - #### @GroovyABI(since = "4.0.0")
      public static Statement checkPropNamesS(VariableExpression namedArgs, boolean pojo, List<PropertyNode> props)

      Creates a statement that validates named-argument keys against the supplied properties.

      Parameters:
        `namedArgs` - the map-style constructor arguments to validate
        `pojo` - whether the generated constructor targets a POJO-style immutable type
        `props` - the properties accepted by the constructor
      Returns:
        a statement that performs the validation

    - #### public static ConstructorCallExpression getFirstIfSpecialConstructorCall(Statement code)

      Return the first statement from the constructor code if it is a call to super or this, otherwise null.

      Parameters:
        `code` - the code to check
      Returns:
        the first statement if a special call or null