|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jcon.data.BeanRecord
public class BeanRecord
This is a wrapper class that takes an arbitrary object and determines the editable properties from it using the JavaBeans introspector. This allows us to perform Record operations on objects that don't implement Record directly.
| Constructor Summary | |
|---|---|
BeanRecord()
Creates a new BeanRecord with no base bean. |
|
BeanRecord(java.lang.Class beanClass)
Creates a new BeanRecord, creating a new base bean by trying to instantiate an instance of the given class using the default constructor. |
|
BeanRecord(java.lang.Object bean)
Creates a new BeanRecord based on the given bean. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Clones both the BeanRecord 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. |
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. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BeanRecord(java.lang.Object bean)
public BeanRecord()
public BeanRecord(java.lang.Class beanClass)
| Method Detail |
|---|
public static java.lang.Object cloneBean(java.lang.Object subject)
public FieldDef getField(java.lang.String fieldName)
getField in interface Recordpublic java.util.Iterator readableFields()
readableFields in interface Recordpublic java.util.Iterator editableFields()
editableFields in interface Record
public java.lang.Object getFieldValue(java.lang.String fieldName)
throws NoSuchFieldInRecordException
getFieldValue in interface RecordNoSuchFieldInRecordException
public void setFieldValue(java.lang.String fieldName,
java.lang.Object value)
throws NoSuchFieldInRecordException
setFieldValue in interface RecordNoSuchFieldInRecordExceptionpublic 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()
clone in interface Recordclone in class java.lang.Objectpublic java.lang.Object getBean()
public void setBean(java.lang.Object newBean)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||