public class Reflection extends Object
| Constructor and Description |
|---|
Reflection()
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
getBoolean(Object
Get a boolean field of an instance.
|
static byte |
getByte(Object
Get a byte field of an instance.
|
static double |
getDouble(Object
Get a double field of an instance.
|
static float |
getFloat(Object
Get a float field of an instance.
|
static int |
getInt(Object
Get a int field of an instance.
|
static long |
getLong(Object
Get a long field of an instance.
|
static Object |
getObject(Object
Get a Object field of an instance.
|
static short |
getShort(Object
Get a short field of an instance.
|
public static byte getByte(Objecto, int k, String name) throws SecurityException , NoSuchFieldException , IllegalArgumentException , IllegalAccessException
o - the instance to get the field from
k - the number of times to dereference the superclass before getting the field
name - the name of the field
SecurityException -
NoSuchFieldException -
IllegalArgumentException -
IllegalAccessException -
public static short getShort(Objecto, int k, String name) throws SecurityException , NoSuchFieldException , IllegalArgumentException , IllegalAccessException
o - the instance to get the field from
k - the number of times to dereference the superclass before getting the field
name - the name of the field
SecurityException -
NoSuchFieldException -
IllegalArgumentException -
IllegalAccessException -
public static int getInt(Objecto, int k, String name) throws SecurityException , NoSuchFieldException , IllegalArgumentException , IllegalAccessException
o - the instance to get the field from
k - the number of times to dereference the superclass before getting the field
name - the name of the field
SecurityException -
NoSuchFieldException -
IllegalArgumentException -
IllegalAccessException -
public static long getLong(Objecto, int k, String name) throws SecurityException , NoSuchFieldException , IllegalArgumentException , IllegalAccessException
o - the instance to get the field from
k - the number of times to dereference the superclass before getting the field
name - the name of the field
SecurityException -
NoSuchFieldException -
IllegalArgumentException -
IllegalAccessException -
public static float getFloat(Objecto, int k, String name) throws SecurityException , NoSuchFieldException , IllegalArgumentException , IllegalAccessException
o - the instance to get the field from
k - the number of times to dereference the superclass before getting the field
name - the name of the field
SecurityException -
NoSuchFieldException -
IllegalArgumentException -
IllegalAccessException -
public static double getDouble(Objecto, int k, String name) throws SecurityException , NoSuchFieldException , IllegalArgumentException , IllegalAccessException
o - the instance to get the field from
k - the number of times to dereference the superclass before getting the field
name - the name of the field
SecurityException -
NoSuchFieldException -
IllegalArgumentException -
IllegalAccessException -
public static boolean getBoolean(Objecto, int k, String name) throws SecurityException , NoSuchFieldException , IllegalArgumentException , IllegalAccessException
o - the instance to get the field from
k - the number of times to dereference the superclass before getting the field
name - the name of the field
SecurityException -
NoSuchFieldException -
IllegalArgumentException -
IllegalAccessException -
public static ObjectgetObject(Object o, int k, String name) throws SecurityException , NoSuchFieldException , IllegalArgumentException , IllegalAccessException
o - the instance to get the field from
k - the number of times to dereference the superclass before getting the field
name - the name of the field
SecurityException -
NoSuchFieldException -
IllegalArgumentException -
IllegalAccessException -