public class ConstructorReference extends SpelNodeImpl
Examples:
new String('hello world')
new int[]{1,2,3,4}
new int[3] new int[3]{1,2,3}
Modifier and Type | Field and Description |
---|---|
private ConstructorExecutor |
cachedExecutor
The cached executor that may be reused on subsequent evaluations.
|
private SpelNodeImpl[] |
dimensions |
private boolean |
isArrayConstructor |
children, pos
Constructor and Description |
---|
ConstructorReference(int pos,
SpelNodeImpl... arguments)
Create a constructor reference.
|
ConstructorReference(int pos,
SpelNodeImpl[] dimensions,
SpelNodeImpl... arguments)
Create a constructor reference.
|
Modifier and Type | Method and Description |
---|---|
private TypedValue |
createArray(ExpressionState state)
Create an array and return it.
|
private TypedValue |
createNewInstance(ExpressionState state)
Create a new ordinary object and return it.
|
private ConstructorExecutor |
findExecutorForConstructor(java.lang.String typename,
java.util.List<TypeDescriptor> argumentTypes,
ExpressionState state)
Go through the list of registered constructor resolvers and see if any can find a constructor that takes the
specified set of arguments.
|
TypedValue |
getValueInternal(ExpressionState state)
Implements getValue() - delegating to the code for building an array or a simple type.
|
private boolean |
hasInitializer() |
private void |
populateBooleanArray(ExpressionState state,
java.lang.Object newArray,
TypeConverter typeConverter,
InlineList initializer) |
private void |
populateByteArray(ExpressionState state,
java.lang.Object newArray,
TypeConverter typeConverter,
InlineList initializer) |
private void |
populateCharArray(ExpressionState state,
java.lang.Object newArray,
TypeConverter typeConverter,
InlineList initializer) |
private void |
populateDoubleArray(ExpressionState state,
java.lang.Object newArray,
TypeConverter typeConverter,
InlineList initializer) |
private void |
populateFloatArray(ExpressionState state,
java.lang.Object newArray,
TypeConverter typeConverter,
InlineList initializer) |
private void |
populateIntArray(ExpressionState state,
java.lang.Object newArray,
TypeConverter typeConverter,
InlineList initializer) |
private void |
populateLongArray(ExpressionState state,
java.lang.Object newArray,
TypeConverter typeConverter,
InlineList initializer) |
private void |
populateReferenceTypeArray(ExpressionState state,
java.lang.Object newArray,
TypeConverter typeConverter,
InlineList initializer,
java.lang.Class<?> componentType) |
private void |
populateShortArray(ExpressionState state,
java.lang.Object newArray,
TypeConverter typeConverter,
InlineList initializer) |
java.lang.String |
toStringAST() |
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, getValueRef, isWritable, nextChildIs, setValue
private boolean isArrayConstructor
private SpelNodeImpl[] dimensions
private volatile ConstructorExecutor cachedExecutor
public ConstructorReference(int pos, SpelNodeImpl... arguments)
public ConstructorReference(int pos, SpelNodeImpl[] dimensions, SpelNodeImpl... arguments)
public TypedValue getValueInternal(ExpressionState state) throws EvaluationException
getValueInternal
in class SpelNodeImpl
EvaluationException
private TypedValue createNewInstance(ExpressionState state) throws EvaluationException
state
- the expression state within which this expression is being evaluatedEvaluationException
- if there is a problem creating the objectprivate ConstructorExecutor findExecutorForConstructor(java.lang.String typename, java.util.List<TypeDescriptor> argumentTypes, ExpressionState state) throws SpelEvaluationException
typename
- the type trying to be constructedargumentTypes
- the types of the arguments supplied that the constructor must takestate
- the current state of the expressionSpelEvaluationException
- if there is a problem locating the constructorpublic java.lang.String toStringAST()
toStringAST
in interface SpelNode
toStringAST
in class SpelNodeImpl
private TypedValue createArray(ExpressionState state) throws EvaluationException
state
- the expression state within which this expression is being evaluatedEvaluationException
- if there is a problem creating the arrayprivate void populateReferenceTypeArray(ExpressionState state, java.lang.Object newArray, TypeConverter typeConverter, InlineList initializer, java.lang.Class<?> componentType)
private void populateByteArray(ExpressionState state, java.lang.Object newArray, TypeConverter typeConverter, InlineList initializer)
private void populateFloatArray(ExpressionState state, java.lang.Object newArray, TypeConverter typeConverter, InlineList initializer)
private void populateDoubleArray(ExpressionState state, java.lang.Object newArray, TypeConverter typeConverter, InlineList initializer)
private void populateShortArray(ExpressionState state, java.lang.Object newArray, TypeConverter typeConverter, InlineList initializer)
private void populateLongArray(ExpressionState state, java.lang.Object newArray, TypeConverter typeConverter, InlineList initializer)
private void populateCharArray(ExpressionState state, java.lang.Object newArray, TypeConverter typeConverter, InlineList initializer)
private void populateBooleanArray(ExpressionState state, java.lang.Object newArray, TypeConverter typeConverter, InlineList initializer)
private void populateIntArray(ExpressionState state, java.lang.Object newArray, TypeConverter typeConverter, InlineList initializer)
private boolean hasInitializer()