|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.util.BeanUtils
public class BeanUtils
Convenience methods for manipulating the getter/setter properties of JavaBeans (well any kind of Object).
These methods are provided purely for convenience to frequent operations. No exceptions are thrown from the methods.
Constructor Summary | |
---|---|
BeanUtils()
|
Method Summary | |
---|---|
static String[] |
getPropertyNames(Object obj)
Get list of property names of bean. |
static Object |
getValue(Object obj,
String property)
Get a single property of the bean. |
static Map |
getValues(Object obj,
String[] allowedProperties)
Get Map of property values from a bean. |
static boolean |
setValue(Object obj,
String property,
Object value)
Set a single property of the bean. |
static void |
setValues(Object obj,
Map valueMap,
String[] allowedProperties)
Set multiple properties of a bean at once using a Map. |
static void |
setValues(Object obj,
Object src,
String[] allowedProperties)
Set multiple properties of a bean at once using properties of another bean. |
static void |
setValues(Object obj,
javax.servlet.ServletRequest request,
String[] allowedProperties)
Set multiple properties of a bean at once using the params passed across from the ServletRequest (useful for mapping HTML forms to beans). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BeanUtils()
Method Detail |
---|
public static final String[] getPropertyNames(Object obj)
obj
- Object to query for property names.
public static final boolean setValue(Object obj, String property, Object value)
obj
- The object to be manipulated.property
- Name of property to set.value
- Value to set property to.
public static final Object getValue(Object obj, String property)
obj
- The object to be accessed.property
- Name of property to get.
public static final void setValues(Object obj, Map valueMap, String[] allowedProperties)
obj
- The object to be manipulated.valueMap
- Map containing property-name (String) / property-value (Object)
pairs to set in the object.allowedProperties
- If array is NOT null, only the properties matching names
passed here shall be set.public static final void setValues(Object obj, Object src, String[] allowedProperties)
obj
- The object to be manipulated.src
- The object containing the properties to be copied.allowedProperties
- If array is NOT null, only the properties matching names
passed here shall be set.public static final void setValues(Object obj, javax.servlet.ServletRequest request, String[] allowedProperties)
obj
- The object to be manipulated.request
- ServletRequest to get params from.allowedProperties
- If array is NOT null, only the properties matching names
passed here shall be set.public static final Map getValues(Object obj, String[] allowedProperties)
obj
- Object to query for properties.allowedProperties
- If array is NOT null, only the properties matching names
passed here shall be retrieved.
|
OSCore Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |