public class ReflectionUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String[] |
PRIMITIVE_NAMES |
protected static java.lang.Class<?>[] |
PRIMITIVES |
Modifier and Type | Method and Description |
---|---|
static java.lang.Class<?> |
forName(java.lang.String name) |
protected static java.lang.Class<?> |
forNamePrimitive(java.lang.String name) |
static java.lang.reflect.Method |
getMethod(java.lang.Object base,
java.lang.Object property,
java.lang.Class<?>[] paramTypes,
java.lang.Object[] paramValues)
Returns a method based on the criteria.
|
static java.lang.reflect.Method[] |
getSetter(java.lang.Class<?> cls,
java.lang.String propertyName)
Get an array of setter methods by a specific propertyName.
|
static java.lang.Class<?>[] |
toTypeArray(java.lang.String[] s)
Converts an array of Class names to Class types.
|
static java.lang.String[] |
toTypeNameArray(java.lang.Class<?>[] c)
Converts an array of Class types to Class names.
|
protected static final java.lang.String[] PRIMITIVE_NAMES
protected static final java.lang.Class<?>[] PRIMITIVES
public static java.lang.Class<?> forName(java.lang.String name) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
protected static java.lang.Class<?> forNamePrimitive(java.lang.String name)
public static java.lang.Class<?>[] toTypeArray(java.lang.String[] s) throws java.lang.ClassNotFoundException
s
- The array of class namesjava.lang.ClassNotFoundException
- If a class of a given name cannot be foundpublic static java.lang.String[] toTypeNameArray(java.lang.Class<?>[] c)
c
- The array of class instancespublic static java.lang.reflect.Method getMethod(java.lang.Object base, java.lang.Object property, java.lang.Class<?>[] paramTypes, java.lang.Object[] paramValues) throws MethodNotFoundException
base
- the object that owns the methodproperty
- the name of the methodparamTypes
- the parameter types to useparamValues
- the parameter valuesMethodNotFoundException
- If a method can not be found that matches
the given criteriapublic static java.lang.reflect.Method[] getSetter(java.lang.Class<?> cls, java.lang.String propertyName)
cls
- propertyName
- Copyright © 2005-2021 Potix Corporation. All Rights Reserved.