|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ckkloverdos.reflect.ReflectUtil
public final class ReflectUtil
Reflection-based utilities.
Method Summary | |
---|---|
static IReflectiveAccessor |
getAccesorForSelect(java.lang.Class c,
java.lang.String propertyName,
boolean isMethodCall)
|
static java.lang.reflect.Constructor |
getConstructor(java.lang.Class clazz,
java.lang.Class[] types,
int yesModifiers)
Gets a Constructor without throwing any exceptions. |
static java.lang.reflect.Constructor |
getConstructor(java.lang.Class clazz,
java.lang.Class[] types,
int yesMod,
int noMod)
Gets a Constructor without throwing any exceptions. |
static java.lang.reflect.Field |
getField(java.lang.Class clazz,
java.lang.String name)
This is a wrapper around Class.getField(String) , but with no exceptions
thrown. |
static java.lang.reflect.Method |
getMethod(java.lang.Class clazz,
java.lang.String name,
java.lang.Class[] types)
This is a wrapper around Class.getMethod(String, Class[]) but with no
exceptions thrown. |
static java.lang.reflect.Method |
getMethodNoArgs(java.lang.Class clazz,
java.lang.String name)
Returns a method with the given name and no arguments of class clazz . |
static IReflectiveAccessor |
getPropertyAccessor(java.lang.Class c,
java.lang.String name)
Obtains the accessor of javabean property. |
static java.lang.Object |
newInstance(java.lang.Class clazz)
Creates and returns a new instance for the class clazz . |
static java.lang.Object |
newInstance(java.lang.String className)
Creates and returns a new instance for the class with name className . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static IReflectiveAccessor getPropertyAccessor(java.lang.Class c, java.lang.String name)
c
- name
- public static java.lang.reflect.Method getMethodNoArgs(java.lang.Class clazz, java.lang.String name)
name
and no arguments of class clazz
.
clazz
- name
- public static java.lang.reflect.Method getMethod(java.lang.Class clazz, java.lang.String name, java.lang.Class[] types)
Class.getMethod(String, Class[])
but with no
exceptions thrown.
clazz
- name
- types
-
name
and parameters or null
if not found.public static java.lang.reflect.Field getField(java.lang.Class clazz, java.lang.String name)
Class.getField(String)
, but with no exceptions
thrown.
clazz
- name
-
clazz
with the given name
or null
if not found.public static java.lang.reflect.Constructor getConstructor(java.lang.Class clazz, java.lang.Class[] types, int yesModifiers)
Constructor
without throwing any exceptions.
Class.getConstructor(Class[])
and the constructor has the requested modifiers.public static java.lang.reflect.Constructor getConstructor(java.lang.Class clazz, java.lang.Class[] types, int yesMod, int noMod)
Constructor
without throwing any exceptions.
Class.getConstructor(Class[])
and the constructor has the requested modifiers.public static java.lang.Object newInstance(java.lang.String className)
className
.
It returns null
if the instance cannot be created.
No exceptions are thrown.
className
- public static java.lang.Object newInstance(java.lang.Class clazz)
clazz
.
It returns null
if the instance cannot be created.
No exceptions are thrown.
clazz
- public static IReflectiveAccessor getAccesorForSelect(java.lang.Class c, java.lang.String propertyName, boolean isMethodCall)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |