|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.binding.value.support.AbstractPropertyChangePublisher
org.springframework.binding.value.support.AbstractValueModel
org.springframework.binding.value.support.BufferedValueModel
public class BufferedValueModel
A value model that wraps another value model; delaying or buffering changes until a commit is triggered. TODO: more class docs...
| Field Summary | |
|---|---|
static String |
BUFFERING_PROPERTY
Name of the bound property buffering. |
| Fields inherited from class org.springframework.binding.value.support.AbstractValueModel |
|---|
logger |
| Fields inherited from interface org.springframework.binding.value.ValueModel |
|---|
VALUE_PROPERTY |
| Constructor Summary | |
|---|---|
BufferedValueModel(ValueModel wrappedModel)
Constructs a BufferedValueHolder that wraps the given wrappedModel. |
|
BufferedValueModel(ValueModel wrappedModel,
CommitTrigger commitTrigger)
Constructs a BufferedValueHolder that wraps the given wrappedModel
and listens to the provided commitTrigger for commit and revert events. |
|
| Method Summary | |
|---|---|
void |
commit()
Commits the value buffered by this value model back to the wrapped value model. |
CommitTrigger |
getCommitTrigger()
Returns the CommitTrigger that is used to trigger commit and flush events. |
ValueModel |
getInnerMostWrappedValueModel()
Returns the inner most wrappedModel; i.e. |
Object |
getValue()
Returns the wrappedModel value if no value has been set since the last commit or flush, and returns the buffered value otherwise. |
protected Object |
getValueToCommit()
Provides a hook that allows for modification of the value that is committed to the underlying value model. |
ValueModel |
getWrappedValueModel()
Returns the wrappedModel, i.e. |
boolean |
isBuffering()
Returns whether this model buffers a value or not, that is, whether a value has been assigned since the last commit or flush. |
protected void |
onWrappedValueChanged()
Called when the value held by the wrapped value model changes. |
void |
revert()
Reverts the value held by the value model back to the value held by the wrapped value model. |
void |
setCommitTrigger(CommitTrigger commitTrigger)
Sets the CommitTrigger that triggers the commit and flush events. |
void |
setValue(Object value)
Sets a new buffered value and turns this BufferedValueModel into the buffering state. |
String |
toString()
|
| Methods inherited from class org.springframework.binding.value.support.AbstractValueModel |
|---|
addValueChangeListener, fireValueChange, fireValueChange, fireValueChange, fireValueChange, fireValueChange, fireValueChangeEvent, fireValueChangeWhenStillEqual, getValueChangeDetector, hasValueChanged, removeValueChangeListener, setValueChangeDetector, setValueSilently |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String BUFFERING_PROPERTY
| Constructor Detail |
|---|
public BufferedValueModel(ValueModel wrappedModel)
BufferedValueHolder that wraps the given wrappedModel.
wrappedModel - the value model to be buffered
public BufferedValueModel(ValueModel wrappedModel,
CommitTrigger commitTrigger)
BufferedValueHolder that wraps the given wrappedModel
and listens to the provided commitTrigger for commit and revert events.
wrappedModel - the value model to be bufferedcommitTrigger - the commit trigger that triggers the commit or flush event| Method Detail |
|---|
public final CommitTrigger getCommitTrigger()
public final void setCommitTrigger(CommitTrigger commitTrigger)
CommitTrigger that triggers the commit and flush events.
commitTrigger - the commit trigger; or null to deregister the
existing trigger.public boolean isBuffering()
public Object getValue()
getValue in interface ValueModelpublic void setValue(Object value)
setValue in interface ValueModelvalue - the value to be bufferedpublic final ValueModel getWrappedValueModel()
getWrappedValueModel in interface ValueModelWrapperpublic final ValueModel getInnerMostWrappedValueModel()
getInnerMostWrappedValueModel in interface ValueModelWrapperValueModelWrapper.getInnerMostWrappedValueModel()protected void onWrappedValueChanged()
public void commit()
protected Object getValueToCommit()
public final void revert()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||