|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.data.provider.impl.AbstractDataProvider
com.sun.data.provider.impl.ObjectDataProvider
This DataProvider wraps access to a single
Java Object. The FieldKeys correspond to the JavaBean properties and
optionally the public member fields of the Java Object.
NOTE about Serializable: This class wraps access to any Java Object. The
Object can be swapped out using the setObject(Object) method.
For this class to remain Serializable, the contained Object must also be
Serializable.
| Field Summary |
| Fields inherited from class com.sun.data.provider.impl.AbstractDataProvider |
dpListeners, fieldKeys |
| Constructor Summary | |
ObjectDataProvider()
Constructs a new ObjectDataProvider with default settings, and no contained Object. |
|
ObjectDataProvider(java.lang.Object object)
Constructs a new ObjectDataProvider to wrap the specified Object. |
|
ObjectDataProvider(java.lang.Object object,
boolean includeFields)
Creates a new ObjectDataProvider to wrap the specified Object. |
|
| Method Summary | |
FieldKey |
getFieldKey(java.lang.String fieldId)
Returns the |
FieldKey[] |
getFieldKeys()
|
java.lang.Object |
getObject()
|
java.lang.Class |
getType(FieldKey fieldKey)
Returns the data type of the data element referenced by the specified data key. |
java.lang.Object |
getValue(FieldKey fieldKey)
Returns value of the data element referenced by the specified
|
boolean |
isIncludeFields()
|
boolean |
isReadOnly(FieldKey fieldKey)
Return a flag indicating whether the value of the data element
represented by the specified |
void |
setIncludeFields(boolean includeFields)
Sets the includeFields property. |
void |
setObject(java.lang.Object object)
Sets the Object to be wrapped by this DataProvider. |
void |
setValue(FieldKey fieldKey,
java.lang.Object value)
Set the value of the data element represented by the specified
|
| Methods inherited from class com.sun.data.provider.impl.AbstractDataProvider |
addDataListener, addFieldKey, addFieldKeys, clearFieldKeys, fireProviderChanged, fireValueChanged, getDataListeners, getFakeData, getFakeData, getType, getValue, isReadOnly, removeDataListener, removeFieldKey, removeFieldKeys, setValue, sortFieldKeys |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ObjectDataProvider()
public ObjectDataProvider(java.lang.Object object)
object - The Object to wrap as a DataProvider
public ObjectDataProvider(java.lang.Object object,
boolean includeFields)
object - The Object to wrap as a DataProviderincludeFields - true to include the public fields, false to only
surface the public properties as FieldKeys.| Method Detail |
public java.lang.Object getObject()
public void setObject(java.lang.Object object)
object - The Object to be wrapped by this DataProviderpublic boolean isIncludeFields()
public void setIncludeFields(boolean includeFields)
Sets the includeFields property. This affects the set of FieldKeys that this DataProvider emits.
If includeFields is set to true (the default), then public fields will
be included in the list of available keys (intermixed with the public
properties). If it is set to false, then only the public properties
will be available.
includeFields - true to include the public fields, or
false to exclude them (and only show public
properties)
public FieldKey getFieldKey(java.lang.String fieldId)
throws DataProviderException
Returns the FieldKey associated with the specified data
element canonical id, if any; otherwise, return null.
getFieldKey in interface DataProvidergetFieldKey in class AbstractDataProviderDataProviderException
public FieldKey[] getFieldKeys()
throws DataProviderException
getFieldKeys in interface DataProvidergetFieldKeys in class AbstractDataProviderDataProviderException
public java.lang.Class getType(FieldKey fieldKey)
throws DataProviderException
Returns the data type of the data element referenced by the specified data key.
getType in interface DataProvidergetType in class AbstractDataProviderDataProviderException
public java.lang.Object getValue(FieldKey fieldKey)
throws DataProviderException
Returns value of the data element referenced by the specified
FieldKey.
getValue in interface DataProvidergetValue in class AbstractDataProviderDataProviderException
public void setValue(FieldKey fieldKey,
java.lang.Object value)
throws DataProviderException
Set the value of the data element represented by the specified
FieldKey to the specified new value.
setValue in interface DataProvidersetValue in class AbstractDataProviderDataProviderException
public boolean isReadOnly(FieldKey fieldKey)
throws DataProviderException
Return a flag indicating whether the value of the data element
represented by the specified FieldKey can be modified via the
setValue() method.
isReadOnly in interface DataProviderisReadOnly in class AbstractDataProviderDataProviderException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||