public class FlattenedBean extends java.lang.Object implements Record
| Constructor and Description |
|---|
FlattenedBean()
Creates a new FlattenedBean with no base bean.
|
FlattenedBean(java.lang.Class beanClass)
Creates a new FlattenedBean, creating a new base bean by trying to
instantiate an instance of the given class using the default constructor.
|
FlattenedBean(java.lang.Object bean)
Creates a new FlattenedBean based on the given bean.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone()
Clones both the FlattenedBean and the subject Record, by setting all
editable properties in the clone to match those in the original.
|
static java.lang.Object |
cloneBean(java.lang.Object subject)
Clones an object that's not normally cloneable.
|
java.util.Iterator |
editableFields()
A list of FieldDefs describing all the editable (readable and writable)
in this Record.
|
void |
flattenProperty(java.lang.String propertyName) |
java.util.Map |
getAllFieldValues()
Field values for all readable fields.
|
java.lang.Object |
getBean()
The bean being operated on.
|
FieldDef |
getField(java.lang.String fieldName)
Returns a FieldDef for the given field.
|
java.lang.Object |
getFieldValue(java.lang.String fieldName)
Gets the value for a given field.
|
java.util.Map |
getFieldValues()
Field values for all editable fields.
|
java.util.Iterator |
readableFields()
A list of FieldDefs describing all the readable fields in this Record.
|
void |
setBean(java.lang.Object newBean)
The bean being operated on.
|
void |
setFieldValue(java.lang.String fieldName,
java.lang.Object value)
Sets the value for a given field.
|
void |
setFieldValues(java.util.Map newFields)
Sets field values.
|
public FlattenedBean(java.lang.Object bean)
public FlattenedBean()
public FlattenedBean(java.lang.Class beanClass)
public static java.lang.Object cloneBean(java.lang.Object subject)
public FieldDef getField(java.lang.String fieldName)
public java.util.Iterator readableFields()
readableFields in interface Recordpublic java.util.Iterator editableFields()
editableFields in interface Recordpublic java.lang.Object getFieldValue(java.lang.String fieldName)
throws NoSuchFieldInRecordException
getFieldValue in interface RecordNoSuchFieldInRecordExceptionpublic void setFieldValue(java.lang.String fieldName,
java.lang.Object value)
throws NoSuchFieldInRecordException,
java.lang.IllegalArgumentException
setFieldValue in interface RecordNoSuchFieldInRecordExceptionjava.lang.IllegalArgumentExceptionpublic java.util.Map getFieldValues()
getFieldValues in interface Recordpublic java.util.Map getAllFieldValues()
getAllFieldValues in interface Recordpublic void setFieldValues(java.util.Map newFields)
Invalid fields are ignored.
setFieldValues in interface RecordnewFields - A dictionary of fieldnames associated with their values.public java.lang.Object clone()
public java.lang.Object getBean()
public void setBean(java.lang.Object newBean)
public void flattenProperty(java.lang.String propertyName)