|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.expression.spel.support.ReflectionHelper
public class ReflectionHelper
Utility methods used by the reflection resolver code to discover the appropriae methods/constructors and fields that should be used in expressions.
Nested Class Summary | |
---|---|
static class |
ReflectionHelper.ArgsMatchKind
|
static class |
ReflectionHelper.ArgumentsMatchInfo
An instance of ArgumentsMatchInfo describes what kind of match was achieved between two sets of arguments - the set that a method/constructor is expecting and the set that are being supplied at the point of invocation. |
Constructor Summary | |
---|---|
ReflectionHelper()
|
Method Summary | |
---|---|
static ReflectionHelper.ArgumentsMatchInfo |
compareArguments(Class[] expectedArgTypes,
Class[] suppliedArgTypes,
TypeConverter typeConverter)
Compare argument arrays and return information about whether they match. |
static ReflectionHelper.ArgumentsMatchInfo |
compareArgumentsVarargs(Class[] expectedArgTypes,
Class[] suppliedArgTypes,
TypeConverter typeConverter)
Compare argument arrays and return information about whether they match. |
static void |
convertAllArguments(Class[] parameterTypes,
boolean isVarargs,
TypeConverter converter,
Object[] arguments)
Convert a supplied set of arguments into the requested types. |
static void |
convertArguments(Class[] requiredParameterTypes,
boolean isVarargs,
TypeConverter converter,
int[] argumentsRequiringConversion,
Object[] arguments)
Takes an input set of argument values and, following the positions specified in the int array, it converts them to the types specified as the required parameter types. |
static Object[] |
setupArgumentsForVarargsInvocation(Class[] requiredParameterTypes,
Object... args)
Package up the arguments so that they correctly match what is expected in parameterTypes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReflectionHelper()
Method Detail |
---|
public static ReflectionHelper.ArgumentsMatchInfo compareArguments(Class[] expectedArgTypes, Class[] suppliedArgTypes, TypeConverter typeConverter)
expectedArgTypes
- the array of types the method/constructor is expectingsuppliedArgTypes
- the array of types that are being supplied at the point of invocationtypeConverter
- a registered type converter
public static ReflectionHelper.ArgumentsMatchInfo compareArgumentsVarargs(Class[] expectedArgTypes, Class[] suppliedArgTypes, TypeConverter typeConverter)
expectedArgTypes
- the array of types the method/constructor is expectingsuppliedArgTypes
- the array of types that are being supplied at the point of invocationtypeConverter
- a registered type converter
public static void convertArguments(Class[] requiredParameterTypes, boolean isVarargs, TypeConverter converter, int[] argumentsRequiringConversion, Object[] arguments) throws EvaluationException
requiredParameterTypes
- the types that the caller would like to haveisVarargs
- whether the requiredParameterTypes is a varargs listconverter
- the type converter to use for attempting conversionsargumentsRequiringConversion
- details which of the input arguments need conversionarguments
- the actual arguments that need conversion
EvaluationException
- if a problem occurs during conversionpublic static void convertAllArguments(Class[] parameterTypes, boolean isVarargs, TypeConverter converter, Object[] arguments) throws SpelEvaluationException
parameterTypes
- the types to be converted toisVarargs
- whether parameterTypes relates to a varargs methodconverter
- the converter to use for type conversionsarguments
- the arguments to convert to the requested parameter types
SpelEvaluationException
- if there is a problem with conversionpublic static Object[] setupArgumentsForVarargsInvocation(Class[] requiredParameterTypes, Object... args)
requiredParameterTypes
- the types of the parameters for the invocationargs
- the arguments to be setup ready for the invocation
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |