|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.iastate.utils.log.BeanUtils
A utility class that provides methods that are useful for dealing with Java Beans.
| Constructor Summary | |
private |
BeanUtils()
|
| Method Summary | |
private static java.lang.Object |
decode(java.lang.Class type,
java.lang.String value)
Decodes a String into an object of the specified type. |
private static java.lang.String |
encode(java.lang.Object value)
Encodes a bean property value as a String. |
static java.util.Map |
getProperties(java.lang.Object bean)
Gets the properties from a Java Bean and returns them in a Map of String name/value pairs. |
static java.beans.PropertyDescriptor[] |
getPropertyDescriptors(java.lang.Class beanClass)
Returns the PropertyDescriptor array for the specified Java Bean Class. |
static void |
setProperties(java.lang.Object bean,
java.util.Map properties)
Sets the properties of a Java Bean based on the String name/value pairs in the specifieed Map. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
private BeanUtils()
| Method Detail |
public static void setProperties(java.lang.Object bean,
java.util.Map properties)
If key/value pairs exist in the Map that don't correspond to properties of the bean, they will be ignored.
bean - the JavaBean to set properties on.properties - String name/value pairs of the properties to set.public static java.util.Map getProperties(java.lang.Object bean)
bean - a Java Bean to get properties from.
public static java.beans.PropertyDescriptor[] getPropertyDescriptors(java.lang.Class beanClass)
throws java.beans.IntrospectionException
beanClass - the Class of the JavaBean.
java.beans.IntrospectionExceptionprivate static java.lang.String encode(java.lang.Object value)
value - an Object to encode in a String representation.
private static java.lang.Object decode(java.lang.Class type,
java.lang.String value)
throws java.lang.Exception
type - the type of the property.value - encode String value to decode.
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||