|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sibvisions.util.type.BeanUtil
public final class BeanUtil
Implements the EL notation for a generic access to object methods or members.
| Method Summary | ||
|---|---|---|
static Object |
get(Object pBean,
String pPropertyName)
Gets the property value from the given bean or sub bean. |
|
static void |
set(Object pBean,
String pPropertyName,
Object pValue)
Sets the property value to the given bean or sub bean. |
|
static
|
toArray(Object[] pSource,
T[] pDest,
String pPropertyName)
Returns an array containing all of the properties identified by pPropertyName
from pSource in proper sequence. |
|
static Hashtable<Object,Object> |
toHashtable(List<?> pObjects,
String pKey,
String pValue)
Returns a hashtable with a specific property as key and a specific property as value. |
|
static
|
toList(Object[] pSource,
String pPropertyName)
Returns a list containing all of the properties identified by pPropertyName
from pSource in proper sequence. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Object get(Object pBean,
String pPropertyName)
Object result = BeanUtil.get(bean, "orders[5].ordernumber");
If the property name is null, the bean is returned.
pBean - the bean.pPropertyName - the property name.
public static void set(Object pBean,
String pPropertyName,
Object pValue)
BeanUtil.set(bean, "orders[5].ordernumber", "4711");
pBean - the bean.pPropertyName - the property name.pValue - the value to set.
public static <T> T[] toArray(Object[] pSource,
T[] pDest,
String pPropertyName)
pPropertyName
from pSource in proper sequence. The runtime type of the returned array is that
of the specified pDest array.
T - the type for the result arraypSource - the source object listpDest - the result arraypPropertyName - the property name for getting the desired values
pSource filled with values
public static <T> List<T> toList(Object[] pSource,
String pPropertyName)
pPropertyName
from pSource in proper sequence. The runtime type of the returned array is that
of the specified pDest array.
T - the type for the result arraypSource - the source object listpPropertyName - the property name for getting the desired values
pSource filled with values
public static Hashtable<Object,Object> toHashtable(List<?> pObjects,
String pKey,
String pValue)
pObjects - a list of objects with properties for the hashtablepKey - the key property namepValue - the value property name
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||