| java.lang.Object simpleorm.simplewebapp.core.WBeanUtils
WBeanUtils | public class WBeanUtils (Code) | | Very simple get/set properties etc.
Can be used in examples, reflection not a core requirement of SimpleWebApp!
Not particularly efficient, no caching of method objects etc.
(No need for the complexity of java.beans or commons bean utils.)
|
Method Summary | |
static Object | getPropertyValue(Object bean, String name) | static Method | propertyMethod(Object bean, String getSet, String name, Class[] params) | public static void | retrieveBeanProperties(Object bean, Collection<WField> fields) Updates fields.values with bean properties in bean. | static void | retrieveBeanProperty(Object bean, WField field) set this field's value from the Java bean (ie. | static void | setPropertyValue(Object bean, String name, Object value, Class clazz) Does bean.setName(value). | public static void | updateBeanProperties(Object bean, Collection<WField> fields) Copies fields.values into bean properties. | static void | updateBeanProperty(Object bean, WField field) set the Java bean's property to this field's value (ie. |
retrieveBeanProperties | public static void retrieveBeanProperties(Object bean, Collection<WField> fields)(Code) | | Updates fields.values with bean properties in bean.
fields parameters is normally getCrudFields().getValues()
Propeties are methods of form getXxx() where Xxx is the field name.
Note silently ignores fields that do not have properties.
|
retrieveBeanProperty | static void retrieveBeanProperty(Object bean, WField field) throws Exception(Code) | | set this field's value from the Java bean (ie. setValue(bean.getName()).
Support for getBeanProperties.
Note that there is no real point in calling this directly for an individual property,
better just to explicitly call its getter.
|
setPropertyValue | static void setPropertyValue(Object bean, String name, Object value, Class clazz) throws Exception(Code) | | Does bean.setName(value).
(clazz parameter is sadly necessary in case value is null.)
|
updateBeanProperty | static void updateBeanProperty(Object bean, WField field) throws Exception(Code) | | set the Java bean's property to this field's value (ie. bean.setName(getValue())).
|
|
|