Package com._1c.g5.aef2.models.value
Class Value<T>
- java.lang.Object
-
- com._1c.g5.aef2.validators.Validable
-
- com._1c.g5.aef2.models.Model
-
- com._1c.g5.aef2.models.EditableModel
-
- com._1c.g5.aef2.models.value.Value<T>
-
- All Implemented Interfaces:
IEditableModel,IModel,IValue<T>,IValidable
- Direct Known Subclasses:
BmValue,EmfValue,PojoValue,ValueWorkingCopy,ViewModelValue
public abstract class Value<T> extends EditableModel implements IValue<T>
BaseIValueimplementation.
-
-
Constructor Summary
Constructors Constructor Description Value()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValueListener(IValueListener<T> listener)Adds the value listener.Value<T>createWorkingCopy()voiddiscard()Discards the changes stored in the model buffer since lastIModel.commit()operation.voiddispose()Disposes this model.Tget()protected TgetCommittedValue()protected TgetUncommittedValue()protected ObjectgetValidatorTarget()Provides validation target for this validable object.booleanisEqual(T other)Checks the value for equality with the current stored value.protected voidnotifyValueChanged(ChangeOrigin changeOrigin)Notifies the listeners about a change of this value.protected voidqueueNotifyValueChanged()Asynchronously notifies the listeners about a change of this value.voidremoveValueListener(IValueListener<T> listener)Removes the value listener.voidset(T value)protected voidsetCommittedValue(T committedValue)protected voidsetUncommittedValue(T uncommittedValue)protected voidsetValue(T value)Sets both the committed and the uncommitted values at the same time.StringtoString()-
Methods inherited from class com._1c.g5.aef2.models.EditableModel
isEditable, setEditable
-
Methods inherited from class com._1c.g5.aef2.models.Model
addModelListener, beginExternalUpdate, checkOffline, checkOnline, commit, endExternalUpdate, getComponent, getCurrentChangeOrigin, getRunnableQueue, isOnline, notifyModelChanged, notifyModelCommitted, removeModelListener, setComponent, setOnline
-
Methods inherited from class com._1c.g5.aef2.validators.Validable
addValidator, removeValidator, validate, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com._1c.g5.aef2.models.IModel
addModelListener, commit, getChange, getComponent, isOnline, removeModelListener, setComponent
-
Methods inherited from interface com._1c.g5.aef2.validators.IValidable
addValidator, removeValidator, validate, validate
-
-
-
-
Method Detail
-
discard
public void discard()
Description copied from interface:IModelDiscards the changes stored in the model buffer since lastIModel.commit()operation.
-
set
public void set(T value)
-
isEqual
public boolean isEqual(T other)
Description copied from interface:IValueChecks the value for equality with the current stored value.
-
addValueListener
public void addValueListener(IValueListener<T> listener)
Description copied from interface:IValueAdds the value listener.- Specified by:
addValueListenerin interfaceIValue<T>- Parameters:
listener- the listener to add.
-
removeValueListener
public void removeValueListener(IValueListener<T> listener)
Description copied from interface:IValueRemoves the value listener.- Specified by:
removeValueListenerin interfaceIValue<T>- Parameters:
listener- the listener to remove.
-
createWorkingCopy
public Value<T> createWorkingCopy()
- Specified by:
createWorkingCopyin interfaceIModel- Specified by:
createWorkingCopyin interfaceIValue<T>- Overrides:
createWorkingCopyin classModel- Returns:
- the model working copy or
nullif working copies is not supported by the model.
-
dispose
public void dispose()
Description copied from interface:IModelDisposes this model.
-
getValidatorTarget
protected Object getValidatorTarget()
Description copied from class:ValidableProvides validation target for this validable object. Override this method to change the validation target of this validable.- Overrides:
getValidatorTargetin classValidable- Returns:
- this object validation target.
-
getCommittedValue
protected final T getCommittedValue()
- Returns:
- the committed value, under normal conditions it should be in sync with data source.
-
setCommittedValue
protected final void setCommittedValue(T committedValue)
- Parameters:
committedValue- the new committed value to set.- See Also:
getCommittedValue()
-
getUncommittedValue
protected final T getUncommittedValue()
- Returns:
- the buffered but yet uncommitted value.
-
setUncommittedValue
protected final void setUncommittedValue(T uncommittedValue)
- Parameters:
uncommittedValue- the new uncommitted value to set.
-
setValue
protected final void setValue(T value)
Sets both the committed and the uncommitted values at the same time.- Parameters:
value- the value to set.
-
notifyValueChanged
protected final void notifyValueChanged(ChangeOrigin changeOrigin)
Notifies the listeners about a change of this value.
-
queueNotifyValueChanged
protected final void queueNotifyValueChanged()
Asynchronously notifies the listeners about a change of this value.
-
-