Package org.zkoss.zel.impl.util
Class ReflectionUtil
java.lang.Object
org.zkoss.zel.impl.util.ReflectionUtil
Utilities for Managing Serialization and Reflection
- Author:
- Jacob Hookom [jacob@hookom.net], samuelbr
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Class<?>protected static Class<?>forNamePrimitive(String name) static MethodReturns a method based on the criteria.static Method[]Get an array of setter methods by a specific propertyName.static Class<?>[]toTypeArray(String[] s) Converts an array of Class names to Class types.static String[]toTypeNameArray(Class<?>[] c) Converts an array of Class types to Class names.
-
Field Details
-
PRIMITIVE_NAMES
-
PRIMITIVES
-
-
Method Details
-
forName
- Throws:
ClassNotFoundException
-
forNamePrimitive
-
toTypeArray
Converts an array of Class names to Class types.- Parameters:
s- The array of class names- Returns:
- An array of Class instance where the element at index i in the result is an instance of the class with the name at index i in the input
- Throws:
ClassNotFoundException- If a class of a given name cannot be found
-
toTypeNameArray
Converts an array of Class types to Class names.- Parameters:
c- The array of class instances- Returns:
- An array of Class names where the element at index i in the result is the name of the class instance at index i in the input
-
getMethod
public static Method getMethod(Object base, Object property, Class<?>[] paramTypes, Object[] paramValues) throws MethodNotFoundException Returns a method based on the criteria.- Parameters:
base- the object that owns the methodproperty- the name of the methodparamTypes- the parameter types to useparamValues- the parameter values- Returns:
- the method specified
- Throws:
MethodNotFoundException- If a method can not be found that matches the given criteria
-
getSetter
Get an array of setter methods by a specific propertyName.- Parameters:
cls-propertyName-- Returns:
- An array of methods
-