|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dyuproject.util.reflect.ReflectUtil
public final class ReflectUtil
Util for java reflections
Constructor Summary | |
---|---|
ReflectUtil()
|
Method Summary | |
---|---|
static Map<String,Method> |
getGetterMethods(Class<?> pojoClass)
Gets the getters of a pojo as a map of String as key and
Method as value. |
static Object |
getInstance(Class<?> clazz)
Tries to invoke Foo.getInstance() if the method (public+static) getInstance() is there. |
static Map<String,Method> |
getSetterMethods(Class<?> pojoClass)
Gets the setters of a pojo as a map of String as key and
Method as value. |
static Object |
newInstance(Class<?> clazz)
Tries to invoke Foo.getInstance() if the method (public+static) getInstance() is there; If not, it creates a new instance via reflection. |
static String |
toField(int start,
String methodName)
Converts a method name into a camel-case field name, starting from start . |
static String |
toProperty(int start,
String methodName)
Converts a method name into a camel-case field name, starting from start . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReflectUtil()
Method Detail |
---|
public static Map<String,Method> getGetterMethods(Class<?> pojoClass)
String
as key and
Method
as value.
public static Map<String,Method> getSetterMethods(Class<?> pojoClass)
String
as key and
Method
as value.
public static String toProperty(int start, String methodName)
start
.
public static String toField(int start, String methodName)
start
.
public static Object getInstance(Class<?> clazz)
public static Object newInstance(Class<?> clazz) throws InstantiationException, IllegalAccessException
InstantiationException
IllegalAccessException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |