spring-framework / org.springframework.expression.spel.support / ReflectionHelper / convertAllArguments

convertAllArguments

open static fun convertAllArguments(converter: TypeConverter, arguments: Array<Any>, method: Method): Boolean

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 - a subsequent call to setupArgumentsForVarargsInvocation handles that.

Parameters

converter - the converter to use for type conversions

arguments - the arguments to convert to the requested parameter types

method - the target Method

Exceptions

SpelEvaluationException - if there is a problem with conversion

Return
true if some kind of conversion occurred on the argument