Package: org.codehaus.groovy.ast.expr

## [Java] Class ConstructorCallExpression

- org.codehaus.groovy.ast.expr.ConstructorCallExpression

- All Implemented Interfaces and Traits:
    MethodCall

      public class ConstructorCallExpression
      extends Expression
      implements MethodCall

  Represents a constructor call expression. This includes regular object construction (e.g., `new MyClass(args)`), as well as special constructor calls like `this()` and `super()` calls within constructors. The constructor is identified by the type being constructed, and the arguments are wrapped in a TupleExpression. May optionally use an anonymous inner class. Explicit constructor type arguments (`new <T>Box(t)`, `<T>this(t)`, `<T>super(t)`) are stored separately from the constructed type's own type arguments.

  See Also:
    MethodCall for the method interface this class implements
    TupleExpression for argument representation
    ClassNode.THIS for `this()` constructor calls
    ClassNode.SUPER for `super()` constructor calls

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class Expression` | `EMPTY_ARRAY`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `ConstructorCallExpression(ClassNode type, Expression arguments)` Creates a constructor call expression.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Expression` | `getArguments()` Returns the constructor arguments.
    `` | `public GenericsType[]` | `getGenericsTypes()` Returns the explicit constructor type arguments, if specified.
    `` | `public String` | `getMethodAsString()`
    `` | `public ASTNode` | `getReceiver()`
    `` | `public String` | `getText()`
    `` | `public boolean` | `isSpecialCall()` Indicates whether this is a special constructor call (`this()` or `super()`).
    `` | `public boolean` | `isSuperCall()` Indicates whether this is a `super()` constructor call.
    `` | `public boolean` | `isThisCall()` Indicates whether this is a `this()` constructor call.
    `` | `public boolean` | `isUsingAnonymousInnerClass()` Indicates whether this constructor call uses an anonymous inner class.
    `` | `public boolean` | `isUsingGenerics()` Indicates whether explicit constructor type arguments are specified.
    `` | `public void` | `setGenericsTypes(GenericsType[] genericsTypes)` Sets the explicit constructor type arguments.
    `` | `public void` | `setUsingAnonymousInnerClass(boolean usage)` Sets whether this constructor call uses an anonymous inner class.
    `` | `public String` | `toString()`
    `` | `public Expression` | `transformExpression(ExpressionTransformer transformer)`
    `` | `public void` | `visit(GroovyCodeVisitor visitor)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Expression` | `getType, setType, transformExpression, transformExpressions, transformExpressions`
    `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 ConstructorCallExpression(ClassNode type, Expression arguments)

      Creates a constructor call expression. Arguments are automatically wrapped in a TupleExpression if not already.

      Parameters:
        `type` - the type being constructed (non-null), or ClassNode.THIS/ClassNode.SUPER for special calls
        `arguments` - the constructor arguments (may be a single expression or already a TupleExpression)

  - ### Method Detail

    - #### public Expression getArguments()

      Returns the constructor arguments.

      Returns:
        a TupleExpression containing the arguments

    - #### public GenericsType[] getGenericsTypes()

      Returns the explicit constructor type arguments, if specified. Used for generic constructor invocations such as `new <String>Box("x")`, `<T>this(t)` and `<T>super(t)`.

      Returns:
        an array of GenericsType parameters, or `null` if none are specified
      Since:
        6.0.0

    - #### public String getMethodAsString()

    - #### public ASTNode getReceiver()

    - #### public String getText()

    - #### public boolean isSpecialCall()

      Indicates whether this is a special constructor call (`this()` or `super()`).

      Returns:
        true if this is a `this()` or `super()` call, false for regular constructor calls

    - #### public boolean isSuperCall()

      Indicates whether this is a `super()` constructor call.

      Returns:
        true if this calls the superclass constructor, false otherwise

    - #### public boolean isThisCall()

      Indicates whether this is a `this()` constructor call.

      Returns:
        true if this calls another constructor in the same class, false otherwise

    - #### public boolean isUsingAnonymousInnerClass()

      Indicates whether this constructor call uses an anonymous inner class.

      Returns:
        true if an anonymous inner class is being created, false for regular construction

    - #### public boolean isUsingGenerics()

      Indicates whether explicit constructor type arguments are specified.

      Returns:
        `true` if type arguments are present; `false` otherwise
      Since:
        6.0.0

    - #### public void setGenericsTypes(GenericsType[] genericsTypes)

      Sets the explicit constructor type arguments.

      Parameters:
        `genericsTypes` - an array of GenericsType parameters; may be `null`
      Since:
        6.0.0

    - #### public void setUsingAnonymousInnerClass(boolean usage)

      Sets whether this constructor call uses an anonymous inner class.

      Parameters:
        `usage` - true if an anonymous inner class is being used, false otherwise

    - #### public String toString()

    - #### public Expression transformExpression(ExpressionTransformer transformer)

    - #### public void visit(GroovyCodeVisitor visitor)