gov.lanl.Utility
Class BeanProperties

java.lang.Object
  |
  +--gov.lanl.Utility.BeanProperties

public class BeanProperties
extends java.lang.Object

Class to set/get Bean properties from/to properties sheet Adapted from Apache Jakarta JSP service example

 

Constructor Summary
BeanProperties()
           
 
Method Summary
static java.lang.Object getProperty(java.lang.Object o, java.lang.String prop)
          get the property from the object using bean accessor
static java.lang.reflect.Method getReadMethod(java.lang.Class beanClass, java.lang.String prop)
          get the read method for reading the specified property
static java.lang.reflect.Method getWriteMethod(java.lang.Class beanClass, java.lang.String prop)
          get the bean write method from the class and for the associated property
static void setProperty(java.lang.Object bean, java.lang.String prop, java.lang.String value)
          set the property in the object using bean accessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanProperties

public BeanProperties()
Method Detail

getProperty

public static java.lang.Object getProperty(java.lang.Object o,
                                           java.lang.String prop)
get the property from the object using bean accessor

Parameters:
o - Object to retrieve property from
prop - (name of property to be retrieved)

setProperty

public static void setProperty(java.lang.Object bean,
                               java.lang.String prop,
                               java.lang.String value)
set the property in the object using bean accessor

Parameters:
bean - Object to send property value to
prop - (name of property to be set)
value - of property to be set

getWriteMethod

public static java.lang.reflect.Method getWriteMethod(java.lang.Class beanClass,
                                                      java.lang.String prop)
get the bean write method from the class and for the associated property

Parameters:
beanClass -
prop - to be written

getReadMethod

public static java.lang.reflect.Method getReadMethod(java.lang.Class beanClass,
                                                     java.lang.String prop)
get the read method for reading the specified property

Parameters:
beanClass -
prop - to be read