Class ConstructorReference

java.lang.Object
org.springframework.expression.spel.ast.SpelNodeImpl
org.springframework.expression.spel.ast.ConstructorReference
All Implemented Interfaces:
Opcodes, SpelNode

public class ConstructorReference extends SpelNodeImpl
Represents the invocation of a constructor: either a constructor on a regular type or construction of an array. When an array is constructed, an initializer can be specified.

Examples

  • new example.Foo()
  • new String('hello world')
  • new int[] {1,2,3,4}
  • new String[] {'abc','xyz'}
  • new int[5]
  • new int[3][4]
Since:
3.0
Author:
Andy Clement, Juergen Hoeller, Sam Brannen, Harry Yang
  • Constructor Details

    • ConstructorReference

      public ConstructorReference(int startPos, int endPos, SpelNodeImpl... arguments)
      Create a constructor reference for a regular type.

      The first argument is the type. The rest are the arguments to the constructor.

    • ConstructorReference

      public ConstructorReference(int startPos, int endPos, SpelNodeImpl[] dimensions, SpelNodeImpl... arguments)
      Create a constructor reference for an array.

      The first argument is the array component type. The second argument is an InlineList representing the array initializer, if an initializer was supplied in the expression.

  • Method Details