| java.lang.Object org.araneaframework.backend.util.BeanMapper
BeanMapper | public class BeanMapper implements Serializable(Code) | | 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.
author: Rein Raudjärv See Also: BeanUtil |
Constructor Summary | |
public | BeanMapper(Class beanClass) Initializes the BeanMapper. | public | BeanMapper(Class beanClass, boolean createMissingBeans) Initializes the BeanMapper. |
Method Summary | |
public Class | getFieldType(String fieldName) Returns type of Bean field identified by name field .
Parameters: fieldName - The name of Bean field. | public Object | getFieldValue(Object bean, String fieldName) Returns the value of Bean field identified with name field
for object bean
Parameters: bean - Object, which value to return. Parameters: fieldName - The name of Bean field. | public List | getFields() Returns List<String> - the List of Bean
field names. | public boolean | isReadable(String fieldName) Checks that the field identified by fieldName is a readable
Bean field.
Parameters: fieldName - Bean field name. | public boolean | isWritable(String fieldName) Checks that the field identified by fieldName is a writable
Bean field.
Parameters: fieldName - Bean field name. | public void | setFieldValue(Object bean, String fieldName, Object value) Sets the value of Bean field identified by name field for
object bean . |
BeanMapper | public BeanMapper(Class beanClass)(Code) | | Initializes the BeanMapper.
Parameters: beanClass - the class implementing the Bean pattern. |
BeanMapper | public BeanMapper(Class beanClass, boolean createMissingBeans)(Code) | | Initializes the BeanMapper.
Parameters: beanClass - the class implementing the Bean pattern. Parameters: createMissingBeans - whetther to create missing beans during writing bean subfields(default is false). |
getFieldType | public Class getFieldType(String fieldName)(Code) | | Returns type of Bean field identified by name field .
Parameters: fieldName - The name of Bean field. The type of the field. |
getFieldValue | public Object getFieldValue(Object bean, String fieldName)(Code) | | Returns the value of Bean field identified with name field
for object bean
Parameters: bean - Object, which value to return. Parameters: fieldName - The name of Bean field. The value of the field. |
getFields | public List getFields()(Code) | | Returns List<String> - the List of Bean
field names.
List<String> - the List of Beanfield names. |
isReadable | public boolean isReadable(String fieldName)(Code) | | Checks that the field identified by fieldName is a readable
Bean field.
Parameters: fieldName - Bean field name. if this field is in Bean. |
isWritable | public boolean isWritable(String fieldName)(Code) | | Checks that the field identified by fieldName is a writable
Bean field.
Parameters: fieldName - Bean field name. if this field is in Bean. |
setFieldValue | public void setFieldValue(Object bean, String fieldName, Object value)(Code) | | Sets the value of Bean field identified by name field for
object bean .
Parameters: bean - bean Object, which value to set. Parameters: fieldName - The name of Bean field. Parameters: value - The new value of the field. |
|
|