|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jaffa.util.BeanHelper
This has convenience methods for dealing with Java Beans.
| Constructor Summary | |
BeanHelper()
|
|
| Method Summary | |
static Object |
convertDataType(Class beanClass,
String propertyName,
String propertyValue)
This method will introspect the beanClass & get the getter method for the input propertyName. |
static Object |
getField(Object bean,
String field)
This will inspect the specified java bean, and extract an Object from the beans getXxx() method, where 'xxx' is the field name passed in. |
static String |
getReaderName(String field)
Get the name of the reader method for the specified string. |
static boolean |
setField(Object bean,
String propertyName,
String propertyValue)
This method will introspect the bean & get the setter method for the input propertyName. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BeanHelper()
| Method Detail |
public static Object getField(Object bean,
String field)
throws NoSuchMethodException
bean - The Java Bean.field - The field.
NoSuchMethodException - if there is no getter for the input field.public static String getReaderName(String field)
field - The field.
public static boolean setField(Object bean,
String propertyName,
String propertyValue)
throws IntrospectionException,
IllegalAccessException,
InvocationTargetException
bean - The bean class to be introspected.propertyName - The Property being searched for.propertyValue - The value to be set.
IntrospectionException - if an exception occurs during introspection.
IllegalAccessException - if the underlying method is inaccessible.
InvocationTargetException - if the underlying method throws an exception.
public static Object convertDataType(Class beanClass,
String propertyName,
String propertyValue)
throws IntrospectionException,
IllegalArgumentException
beanClass - The bean class to be introspected.propertyName - The Property being searched for.propertyValue - The value to be converted.
IntrospectionException - if an exception occurs during introspection.
IllegalArgumentException - if the propertyValue cannot be converted to the appropriate datatype.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||