|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.org.usurper.utils.ReflectionUtils
public final class ReflectionUtils
This class is a reflection utility class
| Method Summary | |
|---|---|
static java.lang.reflect.Field |
getField(java.lang.Object object,
java.lang.String attributeName)
This method gets the Field from an Object and an attribute name. |
static java.lang.reflect.Type[] |
getGenericTypes(java.lang.reflect.Constructor<?> targetConstructor,
java.lang.Integer constructorArgOrderingNumber)
Gets the generic types for a given constructor argument (specified by its ordering number). |
static java.lang.reflect.Type[] |
getGenericTypes(java.lang.reflect.Field attribute)
Gets the generic types for a given field. |
static void |
setProperty(java.lang.Object object,
java.lang.reflect.Method setter,
java.lang.Object value)
This method invokes a property's setter on an object |
static void |
setProperty(java.lang.Object object,
java.lang.String propertyName,
java.lang.Object value)
This method sets a property on an object |
static java.lang.Class<?> |
toNotPrimitiveType(java.lang.Class<?> usurpedClass)
Turns a primitive type to its Object counterpart. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.lang.reflect.Type[] getGenericTypes(java.lang.reflect.Constructor<?> targetConstructor,
java.lang.Integer constructorArgOrderingNumber)
targetConstructor - the target constructorconstructorArgOrderingNumber - the constructor arg ordering number
public static java.lang.reflect.Type[] getGenericTypes(java.lang.reflect.Field attribute)
attribute - the attribute
public static java.lang.reflect.Field getField(java.lang.Object object,
java.lang.String attributeName)
throws java.lang.SecurityException,
java.lang.NoSuchFieldException
object - attributeName -
java.lang.SecurityException
java.lang.NoSuchFieldException
public static void setProperty(java.lang.Object object,
java.lang.String propertyName,
java.lang.Object value)
throws java.lang.SecurityException,
java.lang.NoSuchFieldException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
object - propertyName - value -
java.lang.SecurityException
java.lang.NoSuchFieldException
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
public static void setProperty(java.lang.Object object,
java.lang.reflect.Method setter,
java.lang.Object value)
throws java.lang.IllegalArgumentException,
java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException
object - propertyDescriptor - value -
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
java.lang.IllegalArgumentExceptionpublic static java.lang.Class<?> toNotPrimitiveType(java.lang.Class<?> usurpedClass)
usurpedClass - the usurped class
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||