|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.peaseplate.internal.util.ReflectionUtils
public class ReflectionUtils
Constructor Summary | |
---|---|
ReflectionUtils()
|
Method Summary | |
---|---|
static java.lang.Object[] |
callParameterCommands(BuildContext context,
ICommand[] parameterCommands,
java.lang.reflect.Method method,
java.lang.Object... initialParameters)
Calls the specified parameter commands and converts them to the specified parameter types and returns them as array. |
static java.lang.reflect.Method |
findMethod(java.lang.Class<?> clazz,
java.lang.String name,
int numberOfParameters)
Searches the specified class for a method with the specified name. |
static java.lang.String |
formatMethodName(java.lang.Class<?> clazz,
java.lang.Object name,
int numberOfParameters)
|
static java.lang.Class<?> |
getClass(java.lang.Object value)
Returns the class of the value. |
static java.lang.reflect.Method |
scanMethods(java.lang.Class<?> clazz,
java.lang.String name,
int numberOfParameters)
Scans the specified class for the method with the specified name. |
static java.lang.reflect.Method |
scanMethods(java.lang.reflect.Method[] methods,
java.lang.String name,
int numberOfParameters)
Scans the specified class for the method with the specified name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReflectionUtils()
Method Detail |
---|
public static java.lang.Class<?> getClass(java.lang.Object value)
Void
class
value
- the value
public static java.lang.reflect.Method findMethod(java.lang.Class<?> clazz, java.lang.String name, int numberOfParameters) throws ReflectionException
clazz
- the classname
- the namethe
- number of parameters the method must have
ReflectionException
- if there are multiple methods with the same namepublic static java.lang.reflect.Method scanMethods(java.lang.Class<?> clazz, java.lang.String name, int numberOfParameters) throws ReflectionException
clazz
- the classname
- the namethe
- number of parameters the method must have (at least)
ReflectionException
- if there are multiple method with the same namepublic static java.lang.reflect.Method scanMethods(java.lang.reflect.Method[] methods, java.lang.String name, int numberOfParameters) throws ReflectionException
methods
- the methods to be scannedname
- the namethe
- number of parameters the method must have (at least)
ReflectionException
- if there are multiple method with the same namepublic static java.lang.Object[] callParameterCommands(BuildContext context, ICommand[] parameterCommands, java.lang.reflect.Method method, java.lang.Object... initialParameters) throws TemplateRuntimeException, ReflectionException
context
- the build contextparameterCommands
- the parameter commands, may be nullparameterTypes
- the parameter typesallowVarArgs
- true if the parameter types contain a varargs as last parameterinitialParameters
- if set, these will be converted and inserted in the result
prior to the parameter command results.
TemplateRuntimeException
- on occasion
ReflectionException
public static java.lang.String formatMethodName(java.lang.Class<?> clazz, java.lang.Object name, int numberOfParameters)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |