Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jdbf.engine.reflection
Class ReflectionManager  view ReflectionManager download ReflectionManager.java

java.lang.Object
  extended byorg.jdbf.engine.reflection.ReflectionManager

public class ReflectionManager
extends java.lang.Object

ReflectionManager is the class that handles


Field Summary
private static java.lang.String CLASS_NAME
           
 
Constructor Summary
ReflectionManager()
           
 
Method Summary
static org.jdbf.engine.basic.ObjectMapped createBean(java.lang.String name, java.util.HashMap props)
          Create a ObjectMapped by a CLASS_NAME and a hashmap that contains a list with the names of the properties and relative values.
private static java.lang.Object createNonPrimitiveObject(java.lang.Class cls, java.lang.String value)
          Create a non primitive type for value
static java.lang.String[] getDeclaredFieldsName(org.jdbf.engine.basic.ObjectMapped object)
          Return the name of properties of ObjectMapped object.
static java.lang.String[] getFieldsNames(org.jdbf.engine.basic.ObjectMapped object)
          Return the name of properties of ObjectMapped object.
static java.lang.String[] getPropertyNames(org.jdbf.engine.basic.ObjectMapped object, boolean pk)
          Return name of every property of ObjectMapped object.
static java.lang.Class getPropertyType(org.jdbf.engine.basic.ObjectMapped object, java.lang.String propName)
          Return the type of property di un ObjectMapped pbject, specified the name of property.
static java.lang.reflect.Method getReadMethod(org.jdbf.engine.basic.ObjectMapped object, java.lang.String propName)
          Return the Method object.This object is the get method of property specified in propName.
static java.lang.Object getValueByName(org.jdbf.engine.basic.ObjectMapped object, java.lang.String propName)
          Return value of property of the ObjectMapped object.
static java.lang.reflect.Method getWriteMethod(org.jdbf.engine.basic.ObjectMapped object, java.lang.String propName)
          Return the Method object.This object is the set method of property specified in propName.
static void invokeWriteMethod(org.jdbf.engine.basic.ObjectMapped object, java.lang.reflect.Method method, java.lang.Object value)
          Invoke setter method of a property
static void invokeWriteMethod(org.jdbf.engine.basic.ObjectMapped object, java.lang.reflect.Method method, java.lang.String newValue)
          Invoke the setter method.
static org.jdbf.engine.basic.ObjectMapped setValueByName(org.jdbf.engine.basic.ObjectMapped object, java.lang.String propName, java.lang.Object value)
          Set the value of property of ObjectMapped object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_NAME

private static java.lang.String CLASS_NAME
Constructor Detail

ReflectionManager

public ReflectionManager()
Method Detail

createBean

public static org.jdbf.engine.basic.ObjectMapped createBean(java.lang.String name,
                                                            java.util.HashMap props)
                                                     throws org.jdbf.engine.mapping.MappingException
Create a ObjectMapped by a CLASS_NAME and a hashmap that contains a list with the names of the properties and relative values. If props is null the object created is null.


getValueByName

public static java.lang.Object getValueByName(org.jdbf.engine.basic.ObjectMapped object,
                                              java.lang.String propName)
                                       throws org.jdbf.engine.mapping.MappingException
Return value of property of the ObjectMapped object.


setValueByName

public static org.jdbf.engine.basic.ObjectMapped setValueByName(org.jdbf.engine.basic.ObjectMapped object,
                                                                java.lang.String propName,
                                                                java.lang.Object value)
                                                         throws org.jdbf.engine.mapping.MappingException
Set the value of property of ObjectMapped object


getPropertyType

public static java.lang.Class getPropertyType(org.jdbf.engine.basic.ObjectMapped object,
                                              java.lang.String propName)
                                       throws org.jdbf.engine.mapping.MappingException
Return the type of property di un ObjectMapped pbject, specified the name of property. This method returns the type returned by get method of propName


getPropertyNames

public static java.lang.String[] getPropertyNames(org.jdbf.engine.basic.ObjectMapped object,
                                                  boolean pk)
Return name of every property of ObjectMapped object. This method return the properties of superclass also.


getDeclaredFieldsName

public static java.lang.String[] getDeclaredFieldsName(org.jdbf.engine.basic.ObjectMapped object)
Return the name of properties of ObjectMapped object. Array contains the name of properties of the superclass only.


getFieldsNames

public static java.lang.String[] getFieldsNames(org.jdbf.engine.basic.ObjectMapped object)
Return the name of properties of ObjectMapped object. Array contains the name of properties of ObjectMapped object


getReadMethod

public static java.lang.reflect.Method getReadMethod(org.jdbf.engine.basic.ObjectMapped object,
                                                     java.lang.String propName)
                                              throws org.jdbf.engine.mapping.MappingException
Return the Method object.This object is the get method of property specified in propName.


getWriteMethod

public static java.lang.reflect.Method getWriteMethod(org.jdbf.engine.basic.ObjectMapped object,
                                                      java.lang.String propName)
                                               throws org.jdbf.engine.mapping.MappingException
Return the Method object.This object is the set method of property specified in propName.


invokeWriteMethod

public static void invokeWriteMethod(org.jdbf.engine.basic.ObjectMapped object,
                                     java.lang.reflect.Method method,
                                     java.lang.Object value)
                              throws org.jdbf.engine.mapping.MappingException
Invoke setter method of a property


invokeWriteMethod

public static void invokeWriteMethod(org.jdbf.engine.basic.ObjectMapped object,
                                     java.lang.reflect.Method method,
                                     java.lang.String newValue)
                              throws org.jdbf.engine.mapping.MappingException
Invoke the setter method. It converts the value as parameter. String nothing int Integer.parseInt(value) double Double.parseDouble(value) Finally if value is primitive type , it tries to wrapper it into on primitive type.


createNonPrimitiveObject

private static java.lang.Object createNonPrimitiveObject(java.lang.Class cls,
                                                         java.lang.String value)
Create a non primitive type for value