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.

  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 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 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 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 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)