Save This Page
Home » apache-openjpa-1.1.0-source » org.apache.openjpa » enhance » [javadoc | source]
org.apache.openjpa.enhance
public class: Reflection [javadoc | source]
java.lang.Object
   org.apache.openjpa.enhance.Reflection
Reflection utilities used to support and augment enhancement. Used both at enhancement time and at runtime.
Method from org.apache.openjpa.enhance.Reflection Summary:
findField,   findGetter,   findSetter,   findSetter,   get,   get,   getBoolean,   getBoolean,   getByte,   getByte,   getChar,   getChar,   getDeclaredMethod,   getDouble,   getDouble,   getFloat,   getFloat,   getInt,   getInt,   getLong,   getLong,   getShort,   getShort,   mostDerived,   set,   set,   set,   set,   set,   set,   set,   set,   set,   set,   set,   set,   set,   set,   set,   set,   set,   set,   set,   set,   set,   set,   set,   set,   set,   set,   set
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.openjpa.enhance.Reflection Detail:
 public static Field findField(Class cls,
    String name,
    boolean mustExist) 
    Return the field with the given name, optionally throwing an exception if none.
 public static Method findGetter(Class cls,
    String prop,
    boolean mustExist) 
    Return the getter method matching the given property name, optionally throwing an exception if none.
 public static Method findSetter(Class cls,
    String prop,
    boolean mustExist) 
    Return the setter method matching the given property name, optionally throwing an exception if none. The property must also have a getter.
 public static Method findSetter(Class cls,
    String prop,
    Class param,
    boolean mustExist) 
    Return the setter method matching the given property name, optionally throwing an exception if none.
 public static Object get(Object target,
    Field field) 
    Return the value of the given field in the given object.
 public static Object get(Object target,
    Method getter) 
    Return the return value of the given getter in the given object.
 public static boolean getBoolean(Object target,
    Field field) 
    Return the value of the given field in the given object.
 public static boolean getBoolean(Object target,
    Method getter) 
    Return the return value of the given getter in the given object.
 public static byte getByte(Object target,
    Field field) 
    Return the value of the given field in the given object.
 public static byte getByte(Object target,
    Method getter) 
    Return the return value of the given getter in the given object.
 public static char getChar(Object target,
    Field field) 
    Return the value of the given field in the given object.
 public static char getChar(Object target,
    Method getter) 
    Return the return value of the given getter in the given object.
 static Method getDeclaredMethod(Class cls,
    String name,
    Class param) 
    Invokes cls.getDeclaredMethods(), and returns the method that matches the name and param arguments. Avoids the exception thrown by Class.getDeclaredMethod() for performance reasons. param may be null. Additionally, if there are multiple methods with different return types, this will return the method defined in the least-derived class.
 public static double getDouble(Object target,
    Field field) 
    Return the value of the given field in the given object.
 public static double getDouble(Object target,
    Method getter) 
    Return the return value of the given getter in the given object.
 public static float getFloat(Object target,
    Field field) 
    Return the value of the given field in the given object.
 public static float getFloat(Object target,
    Method getter) 
    Return the return value of the given getter in the given object.
 public static int getInt(Object target,
    Field field) 
    Return the value of the given field in the given object.
 public static int getInt(Object target,
    Method getter) 
    Return the return value of the given getter in the given object.
 public static long getLong(Object target,
    Field field) 
    Return the value of the given field in the given object.
 public static long getLong(Object target,
    Method getter) 
    Return the return value of the given getter in the given object.
 public static short getShort(Object target,
    Field field) 
    Return the value of the given field in the given object.
 public static short getShort(Object target,
    Method getter) 
    Return the return value of the given getter in the given object.
 static Method mostDerived(Method meth1,
    Method meth2) 
 public static  void set(Object target,
    Field field,
    Object value) 
    Set the value of the given field in the given object.
 public static  void set(Object target,
    Field field,
    boolean value) 
    Set the value of the given field in the given object.
 public static  void set(Object target,
    Field field,
    byte value) 
    Set the value of the given field in the given object.
 public static  void set(Object target,
    Field field,
    char value) 
    Set the value of the given field in the given object.
 public static  void set(Object target,
    Field field,
    double value) 
    Set the value of the given field in the given object.
 public static  void set(Object target,
    Field field,
    float value) 
    Set the value of the given field in the given object.
 public static  void set(Object target,
    Field field,
    int value) 
    Set the value of the given field in the given object.
 public static  void set(Object target,
    Field field,
    long value) 
    Set the value of the given field in the given object.
 public static  void set(Object target,
    Field field,
    short value) 
    Set the value of the given field in the given object.
 public static  void set(Object target,
    Object value,
    Field field) 
    Set the value of the given field in the given object. Same behavior as above methods, but parameter ordering is rearranged to simplify usage from generated bytecodes.
 public static  void set(Object target,
    boolean value,
    Field field) 
    Set the value of the given field in the given object. Same behavior as above methods, but parameter ordering is rearranged to simplify usage from generated bytecodes.
 public static  void set(Object target,
    byte value,
    Field field) 
    Set the value of the given field in the given object. Same behavior as above methods, but parameter ordering is rearranged to simplify usage from generated bytecodes.
 public static  void set(Object target,
    char value,
    Field field) 
    Set the value of the given field in the given object. Same behavior as above methods, but parameter ordering is rearranged to simplify usage from generated bytecodes.
 public static  void set(Object target,
    double value,
    Field field) 
    Set the value of the given field in the given object. Same behavior as above methods, but parameter ordering is rearranged to simplify usage from generated bytecodes.
 public static  void set(Object target,
    float value,
    Field field) 
    Set the value of the given field in the given object. Same behavior as above methods, but parameter ordering is rearranged to simplify usage from generated bytecodes.
 public static  void set(Object target,
    int value,
    Field field) 
    Set the value of the given field in the given object. Same behavior as above methods, but parameter ordering is rearranged to simplify usage from generated bytecodes.
 public static  void set(Object target,
    long value,
    Field field) 
    Set the value of the given field in the given object. Same behavior as above methods, but parameter ordering is rearranged to simplify usage from generated bytecodes.
 public static  void set(Object target,
    short value,
    Field field) 
    Set the value of the given field in the given object. Same behavior as above methods, but parameter ordering is rearranged to simplify usage from generated bytecodes.
 public static  void set(Object target,
    Method setter,
    Object value) 
    Invoke the given setter on the given object.
 public static  void set(Object target,
    Method setter,
    boolean value) 
    Invoke the given setter on the given object.
 public static  void set(Object target,
    Method setter,
    byte value) 
    Invoke the given setter on the given object.
 public static  void set(Object target,
    Method setter,
    char value) 
    Invoke the given setter on the given object.
 public static  void set(Object target,
    Method setter,
    double value) 
    Invoke the given setter on the given object.
 public static  void set(Object target,
    Method setter,
    float value) 
    Invoke the given setter on the given object.
 public static  void set(Object target,
    Method setter,
    int value) 
    Invoke the given setter on the given object.
 public static  void set(Object target,
    Method setter,
    long value) 
    Invoke the given setter on the given object.
 public static  void set(Object target,
    Method setter,
    short value) 
    Invoke the given setter on the given object.