|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.expression.spel.ast.SpelNodeImpl
org.springframework.expression.spel.ast.ConstructorReference
public class ConstructorReference
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 String('hello world')
new int[]{1,2,3,4}
new int[3] new int[3]{1,2,3}
Field Summary | |
---|---|
private ConstructorExecutor |
cachedExecutor
The cached executor that may be reused on subsequent evaluations. |
private SpelNodeImpl[] |
dimensions
|
private boolean |
isArrayConstructor
|
Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl |
---|
children, pos |
Constructor Summary | |
---|---|
ConstructorReference(int pos,
SpelNodeImpl... arguments)
Create a constructor reference. |
|
ConstructorReference(int pos,
SpelNodeImpl[] dimensions,
SpelNodeImpl... arguments)
Create a constructor reference. |
Method Summary | |
---|---|
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()
|
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl |
---|
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private boolean isArrayConstructor
private SpelNodeImpl[] dimensions
private volatile ConstructorExecutor cachedExecutor
Constructor Detail |
---|
public ConstructorReference(int pos, SpelNodeImpl... arguments)
public ConstructorReference(int pos, SpelNodeImpl[] dimensions, SpelNodeImpl... arguments)
Method Detail |
---|
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 evaluated
EvaluationException
- 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 expression
SpelEvaluationException
- 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 evaluated
EvaluationException
- 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()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |