java.lang.Objectorg.objectweb.telosys.util.BeanUtil
Utility class for BEAN operations ( set of static methods )
Field Summary | |
static int |
ALL_METHODS
|
static int |
CLASS_DECLARED_METHODS
|
Method Summary | |
static java.lang.String |
getAttributeName(java.lang.String sName)
Returns the "attribute name" from the variable name ( in standard "dot notation" ) |
static java.lang.String |
getBeanName(java.lang.String sName)
Returns the "bean name" from the variable name ( in standard "dot notation" ) |
static java.lang.Object |
getFieldValue(java.lang.Object oBean,
java.lang.String sFieldName)
Returns the value of the given bean field using reflection |
static void |
setFieldValue(java.lang.Object oBean,
java.lang.String sFieldName,
java.lang.String sFieldValue)
Sets the value of the given bean field using reflection |
static void |
shallowCopy(java.lang.Object orig,
java.lang.Object dest)
Shallow copy of a bean to another, attribute by attribute : call "setXxxx" with corresponding "getXxxx" or "isXxxx" NB: the 2 beans must be instances of the same class |
static void |
shallowCopy(java.lang.Object orig,
java.lang.Object dest,
int iFlag)
Shallow copy of a bean to another, attribute by attribute : call "setXxxx" with corresponding "getXxxx" or "isXxxx" NB: the 2 beans must be instances of the same class |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ALL_METHODS
public static final int CLASS_DECLARED_METHODS
Method Detail |
public static final void shallowCopy(java.lang.Object orig, java.lang.Object dest)
orig
- : the original bean to copydest
- : the destination beanpublic static final void shallowCopy(java.lang.Object orig, java.lang.Object dest, int iFlag)
orig
- : the original bean to copydest
- : the destination beaniFlag
- : indicates the introspection level : public static void setFieldValue(java.lang.Object oBean, java.lang.String sFieldName, java.lang.String sFieldValue)
oBean
- : the bean instancesFieldName
- : the field namesFieldValue
- : the value to set (it will be converted to the expected type)public static java.lang.Object getFieldValue(java.lang.Object oBean, java.lang.String sFieldName) throws TelosysException
oBean
- : the bean instancesFieldName
- : the field name
TelosysException
- if the field name is unknown or if arguments are invalidpublic static java.lang.String getBeanName(java.lang.String sName)
sName
- : the variable name to parse ( 'bean.attribute' )
public static java.lang.String getAttributeName(java.lang.String sName)
sName
- : the variable name to parse ( 'bean.attribute', 'bean', '.attribute' )