|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.araneaframework.backend.util.BeanMapper
This class provides a way to manipulate Bean fields. This class
assumes that the class passed to constructor (BeanClass)
implements the Bean pattern - that is to open it's fields using
getters and setters (read-only fields are permitted). The only names
permitted are those starting with "get", "is" and "set". Another requirement
is that Beans must have a constructor that doesn't take any
parameters.
BeanUtil,
Serialized Form| Constructor Summary | |
BeanMapper(Class beanClass)
Initializes the BeanMapper. |
|
BeanMapper(Class beanClass,
boolean createMissingBeans)
Initializes the BeanMapper. |
|
| Method Summary | |
List |
getFields()
Returns List<String>- the List of Bean
field names. |
Class |
getFieldType(String fieldName)
Returns type of Bean field identified by name field. |
Object |
getFieldValue(Object bean,
String fieldName)
Returns the value of Bean field identified with name field
for object bean |
boolean |
isReadable(String fieldName)
Checks that the field identified by fieldName is a readable
Bean field. |
boolean |
isWritable(String fieldName)
Checks that the field identified by fieldName is a writable
Bean field. |
void |
setFieldValue(Object bean,
String fieldName,
Object value)
Sets the value of Bean field identified by name field for
object bean. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BeanMapper(Class beanClass)
beanClass - the class implementing the Bean pattern.
public BeanMapper(Class beanClass,
boolean createMissingBeans)
beanClass - the class implementing the Bean pattern.createMissingBeans - whetther to create missing beans during writing bean subfields
(default is false).| Method Detail |
public List getFields()
List<String>- the List of Bean
field names.
List<String>- the List of Bean
field names.
public Object getFieldValue(Object bean,
String fieldName)
field
for object bean
bean - Object, which value to return.fieldName - The name of Bean field.
public void setFieldValue(Object bean,
String fieldName,
Object value)
field for
object bean.
bean - bean Object, which value to set.fieldName - The name of Bean field.value - The new value of the field.public Class getFieldType(String fieldName)
field.
fieldName - The name of Bean field.
public boolean isReadable(String fieldName)
fieldName is a readable
Bean field.
fieldName - Bean field name.
public boolean isWritable(String fieldName)
fieldName is a writable
Bean field.
fieldName - Bean field name.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||