Class Overview
Utility methods used by the reflection resolver code to discover the appropriate
methods/constructors and fields that should be used in expressions.
Summary
Nested Classes |
enum |
ReflectionHelper.ArgsMatchKind |
|
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. |
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
Public Constructors
public
ReflectionHelper
()
Public Methods
public
static
void
convertAllArguments
(TypeConverter converter, Object[] arguments, Method method)
Convert a supplied set of arguments into the requested types. If the parameterTypes are related to
a varargs method then the final entry in the parameterTypes array is going to be an array itself whose
component type should be used as the conversion target for extraneous arguments. (For example, if the
parameterTypes are {Integer, String[]} and the input arguments are {Integer, boolean, float} then both
the boolean and float must be converted to strings). This method does not repackage the arguments
into a form suitable for the varargs invocation
Parameters
converter
| the converter to use for type conversions |
arguments
| the arguments to convert to the requested parameter types |
method
| the target Method |
public
static
Object[]
setupArgumentsForVarargsInvocation
(Class[] requiredParameterTypes, Object... args)
Package up the arguments so that they correctly match what is expected in parameterTypes. For example, if
parameterTypes is (int, String[]) because the second parameter was declared String... then if arguments is
[1,"a","b"] then it must be repackaged as [1,new String[]{"a","b"}] in order to match the expected
parameterTypes.
Parameters
requiredParameterTypes
| the types of the parameters for the invocation |
args
| the arguments to be setup ready for the invocation |
Returns
- a repackaged array of arguments where any varargs setup has been done