net.csdn.common.reflect
Class ReflectHelper
java.lang.Object
net.csdn.common.reflect.ReflectHelper
public class ReflectHelper
- extends Object
User: WilliamZhu
Date: 12-7-12
Time: 下午4:48
|
Method Summary |
static Annotation[] |
annotation(Object obj,
String fieldName)
|
static Object |
field(Object obj,
Class clzz,
String fieldName)
|
static void |
field(Object obj,
Class clzz,
String fieldName,
Object value)
|
static Object |
field(Object obj,
String fieldName)
|
static void |
field(Object obj,
String fieldName,
Object value)
|
static List<Field> |
fields(Class clzz,
Class annotation)
|
static Field |
findField(Class clzz,
String fieldName)
|
static List<Field> |
findFieldsByAnnotation(Class clzz,
Class annotation)
|
static Method |
findMethodByName(Class clzz,
String methodName)
|
static List<Method> |
findMethodsByAnnotation(Class clzz,
Class annotation)
|
static Method |
findTTMethod(Class clazz,
String methodName,
Class... paramTypes)
|
static List<Method> |
findTTMethods(Class clazz,
String methodName)
|
static Object |
method(Object obj,
String methodName)
|
static Object |
method(Object obj,
String methodName,
Object... params)
|
static void |
method2(Object obj,
String methodName)
|
static List<Method> |
methods(Class clzz,
Class annotation)
|
static Class[] |
paramsToTypes(Object... params)
|
static Object |
staticField(Class obj,
String fieldName)
|
static void |
staticField(Class obj,
String fieldName,
Object value)
|
static Object |
staticMethod(Class obj,
String methodName,
Object... params)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReflectHelper
public ReflectHelper()
fields
public static List<Field> fields(Class clzz,
Class annotation)
methods
public static List<Method> methods(Class clzz,
Class annotation)
findFieldsByAnnotation
public static List<Field> findFieldsByAnnotation(Class clzz,
Class annotation)
findMethodsByAnnotation
public static List<Method> findMethodsByAnnotation(Class clzz,
Class annotation)
findField
public static Field findField(Class clzz,
String fieldName)
findMethodByName
public static Method findMethodByName(Class clzz,
String methodName)
field
public static void field(Object obj,
String fieldName,
Object value)
throws Exception
- Throws:
Exception
field
public static Object field(Object obj,
String fieldName)
throws Exception
- Throws:
Exception
staticField
public static Object staticField(Class obj,
String fieldName)
staticField
public static void staticField(Class obj,
String fieldName,
Object value)
field
public static void field(Object obj,
Class clzz,
String fieldName,
Object value)
throws Exception
- Throws:
Exception
field
public static Object field(Object obj,
Class clzz,
String fieldName)
throws Exception
- Throws:
Exception
findTTMethod
public static Method findTTMethod(Class clazz,
String methodName,
Class... paramTypes)
findTTMethods
public static List<Method> findTTMethods(Class clazz,
String methodName)
method2
public static void method2(Object obj,
String methodName)
method
public static Object method(Object obj,
String methodName)
staticMethod
public static Object staticMethod(Class obj,
String methodName,
Object... params)
method
public static Object method(Object obj,
String methodName,
Object... params)
paramsToTypes
public static Class[] paramsToTypes(Object... params)
annotation
public static Annotation[] annotation(Object obj,
String fieldName)
throws Exception
- Throws:
Exception
Copyright © 2014. All Rights Reserved.