public class ReflectUtils extends Object
| 构造器和说明 |
|---|
ReflectUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
getBooleanField(Object o,
String name)
Get field's value.
|
static byte |
getByteField(Object o,
String name)
Get field's value.
|
static char |
getCharField(Object o,
String name)
Get field's value.
|
static double |
getDoubleField(Object o,
String name)
Get field's value.
|
static <T> T |
getField(Object o,
String name)
Get field's value.
|
static float |
getFloatField(Object o,
String name)
Get field's value.
|
static int |
getIntField(Object o,
String name)
Get field's value.
|
static long |
getLongField(Object o,
String name)
Get field's value.
|
static short |
getShortField(Object o,
String name)
Get field's value.
|
static byte |
getStaticByteField(Class cls,
String name)
Get field's value.
|
static char |
getStaticCharField(Class cls,
String name)
Get field's value.
|
static double |
getStaticDoubleField(Class cls,
String name)
Get field's value.
|
static <T> T |
getStaticField(Class cls,
String name)
Get field's value.
|
static float |
getStaticFloatField(Class cls,
String name)
Get field's value.
|
static int |
getStaticIntField(Class cls,
String name)
Get field's value.
|
static long |
getStaticLongField(Class cls,
String name)
Get field's value.
|
static short |
getStaticShortField(Class cls,
String name)
Get field's value.
|
static boolean |
isArray(Object obj)
If obj is array.
|
static boolean |
isPrimitive(Class cls)
If cls is a primitive class
|
static void |
setBooleanField(Object o,
String name,
boolean value)
Set field's value.
|
static void |
setByteField(Object o,
String name,
byte value)
Set field's value.
|
static void |
setCharField(Object o,
String name,
char value)
Set field's value.
|
static void |
setDoubleField(Object o,
String name,
double value)
Set field's value.
|
static void |
setField(Object o,
String name,
Object value)
Set field's value.
|
static void |
setFloatField(Object o,
String name,
float value)
Set field's value.
|
static void |
setIntField(Object o,
String name,
int value)
Set field's value.
|
static void |
setLongField(Object o,
String name,
long value)
Set field's value.
|
static void |
setShortField(Object o,
String name,
short value)
Set field's value.
|
static void |
setStaticByteField(Class cls,
String name,
byte value)
Set field's value.
|
static void |
setStaticCharField(Class cls,
String name,
char value)
Set field's value.
|
static void |
setStaticDoubleField(Class cls,
String name,
double value)
Set field's value.
|
static void |
setStaticField(Class cls,
String name,
Object value)
Set field's value.
|
static void |
setStaticFloatField(Class cls,
String name,
float value)
Set field's value.
|
static void |
setStaticIntField(Class cls,
String name,
int value)
Set field's value.
|
static void |
setStaticLongField(Class cls,
String name,
long value)
Set field's value.
|
static void |
setStaticShortField(Class cls,
String name,
short value)
Set field's value.
|
public static boolean isPrimitive(Class cls)
public static boolean isArray(Object obj)
public static void setBooleanField(Object o, String name, boolean value)
public static void setFloatField(Object o, String name, float value)
public static void setDoubleField(Object o, String name, double value)
public static void setShortField(Object o, String name, short value)
public static float getStaticFloatField(Class cls, String name)
public static double getStaticDoubleField(Class cls, String name)
public static short getStaticShortField(Class cls, String name)
public static void setStaticField(Class cls, String name, Object value)
public static void setStaticIntField(Class cls, String name, int value)
public static void setStaticLongField(Class cls, String name, long value)
public static void setStaticFloatField(Class cls, String name, float value)
public static void setStaticDoubleField(Class cls, String name, double value)
public static void setStaticByteField(Class cls, String name, byte value)
public static void setStaticShortField(Class cls, String name, short value)
Copyright © 2015. All rights reserved.