|
||||||||||
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.BasicTransactionalDataProvider
public class BasicTransactionalDataProvider
Field Summary | |
---|---|
protected java.util.HashMap |
changeMap
|
protected DataListener |
ears
|
protected DataProvider |
provider
|
Fields inherited from class com.sun.data.provider.impl.AbstractDataProvider |
---|
dpListeners, fieldKeys |
Constructor Summary | |
---|---|
BasicTransactionalDataProvider()
|
Method Summary | |
---|---|
void |
addTransactionalDataListener(TransactionalDataListener l)
Register a new |
void |
commitChanges()
Cause any cached changes to values of data elements supported by this DataProvider to be passed through to the underlying data
structure. |
protected void |
fireChangesCommitted()
Fires a changesCommtted event to each registered TransactionalDataListener |
protected void |
fireChangesReverted()
Fires a changesReverted event to each registered TransactionalDataListener |
DataProvider |
getDataProvider()
|
FieldKey |
getFieldKey(java.lang.String fieldId)
Returns the |
FieldKey[] |
getFieldKeys()
|
TransactionalDataListener[] |
getTransactionalDataListeners()
|
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 |
isReadOnly(FieldKey fieldKey)
Return a flag indicating whether the value of the data element
represented by the specified |
void |
removeTransactionalDataListener(TransactionalDataListener l)
Deregister an existing |
void |
revertChanges()
Cause any cached changes to values of data elements supported by this DataProvider to be thrown away, so that the initial values are
again visible. |
void |
setDataProvider(DataProvider provider)
|
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 |
Methods inherited from interface com.sun.data.provider.DataProvider |
---|
addDataListener, getDataListeners, removeDataListener |
Field Detail |
---|
protected DataProvider provider
protected java.util.HashMap changeMap
protected DataListener ears
Constructor Detail |
---|
public BasicTransactionalDataProvider()
Method Detail |
---|
public void setDataProvider(DataProvider provider)
provider
- DataProviderpublic DataProvider getDataProvider()
public FieldKey[] getFieldKeys() throws DataProviderException
getFieldKeys
in interface DataProvider
getFieldKeys
in class AbstractDataProvider
FieldKey
s supported by this
DataProvider
. If the set of valid FieldKey
s cannot
be determined, return null
instead.
DataProviderException
- Implementations may wish to surface
internal exceptions (nested in DataProviderException) rather
than simply returning null or an empty array. Consult the
documentation of the specific DataProvider implementation for
details on what exceptions might be wrapped by a DPE.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 DataProvider
getFieldKey
in class AbstractDataProvider
fieldId
- Canonical id of the requested FieldKey
FieldKey
associated with the specified data
element canonical id, if any; otherwise, return
null
DataProviderException
- Implementations may wish to surface
internal exceptions (nested in DataProviderException) rather
than simply returning null. A DPE may also indicate that the
passed fieldId is not valid. Consult the documentation of the
specific DataProvider implementation for details on what
exceptions might be wrapped by a DPE.public java.lang.Class getType(FieldKey fieldKey) throws DataProviderException
AbstractDataProvider
Returns the data type of the data element referenced by the specified data key.
getType
in interface DataProvider
getType
in class AbstractDataProvider
fieldKey
- FieldKey
DataProviderException
- Implementations may wish to surface
internal exceptions (nested in DataProviderException) rather
than simply returning null. A DPE may also indicate that the
passed fieldKey is not valid. Consult the documentation of the
specific DataProvider implementation for details on what
exceptions might be wrapped by a DPE.public java.lang.Object getValue(FieldKey fieldKey) throws DataProviderException
Returns value of the data element referenced by the specified
FieldKey
.
getValue
in interface DataProvider
getValue
in class AbstractDataProvider
fieldKey
- FieldKey
identifying the data element
whose value is to be returned
FieldKey
DataProviderException
- Implementations may wish to surface
internal exceptions (nested in DataProviderException) rather
than simply returning null. A DPE may also indicate that the
passed fieldKey is not valid. Consult the documentation of the
specific DataProvider implementation for details on what
exceptions might be wrapped by a DPE.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 DataProvider
isReadOnly
in class AbstractDataProvider
fieldKey
- FieldKey
identifying the data element
whose settable status is to be returned
FieldKey
can be modified
via the setValue()
method
DataProviderException
- Implementations may wish to surface
internal exceptions (nested in DataProviderException) rather
than simply returning true. A DPE may also indicate that the
passed fieldKey is not valid. Consult the documentation of the
specific DataProvider implementation for details on what
exceptions might be wrapped by a DPE.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 DataProvider
setValue
in class AbstractDataProvider
fieldKey
- FieldKey
identifying the data element
whose value is to be modifiedvalue
- New value for this data element
DataProviderException
- Implementations may wish to surface
internal exceptions (nested in DataProviderException) rather
than simply returning null. A DPE may also indicate that the
passed fieldKey is not valid. Consult the documentation of the
specific DataProvider implementation for details on what
exceptions might be wrapped by a DPE.public void commitChanges() throws DataProviderException
TransactionalDataProvider
Cause any cached changes to values of data elements supported by this
DataProvider
to be passed through to the underlying data
structure.
commitChanges
in interface TransactionalDataProvider
DataProviderException
- Implementations may wish to surface
internal exceptions (nested in DataProviderException). Consult
the documentation of the specific DataProvider implementation for
details on what exceptions might be wrapped by a DPE.public void revertChanges() throws DataProviderException
TransactionalDataProvider
Cause any cached changes to values of data elements supported by this
DataProvider
to be thrown away, so that the initial values are
again visible.
revertChanges
in interface TransactionalDataProvider
DataProviderException
- Implementations may wish to surface
internal exceptions (nested in DataProviderException). Consult
the documentation of the specific DataProvider implementation for
details on what exceptions might be wrapped by a DPE.public void addTransactionalDataListener(TransactionalDataListener l)
Register a new TransactionalDataListener
to this
TransactionalDataProvider
instance.
addTransactionalDataListener
in interface TransactionalDataProvider
l
- New TransactionalDataListener
to registerpublic void removeTransactionalDataListener(TransactionalDataListener l)
Deregister an existing TransactionalDataListener
from
TransactionalDataProvider
instance.
removeTransactionalDataListener
in interface TransactionalDataProvider
l
- Old TransactionalDataListener
to removepublic TransactionalDataListener[] getTransactionalDataListeners()
getTransactionalDataListeners
in interface TransactionalDataProvider
TransactionalDataListener
s
currently registered on this TransactionalDataProvider
.
If there are no registered listeners, a zero-length array is
returned.protected void fireChangesCommitted()
TransactionalDataListener
TransactionalDataListener.changesCommitted(TransactionalDataProvider)
protected void fireChangesReverted()
TransactionalDataListener
TransactionalDataListener.changesReverted(TransactionalDataProvider)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |