|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.globalmentor.beans.BoundPropertyObject
com.guiseframework.model.AbstractModel
com.guiseframework.model.AbstractValueModel<V>
com.guiseframework.model.DefaultValueModel<V>
V - The type of value contained in the model.public class DefaultValueModel<V>
A default implementation of a model representing a value.
| Field Summary |
|---|
| Fields inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS |
| Fields inherited from interface com.guiseframework.model.ValueModel |
|---|
VALIDATOR_PROPERTY, VALUE_PROPERTY |
| Fields inherited from interface com.guiseframework.model.Model |
|---|
PLAIN_TEXT_CONTENT_TYPE, XHTML_CONTENT_TYPE, XHTML_FRAGMENT_CONTENT_TYPE |
| Constructor Summary | |
|---|---|
DefaultValueModel(java.lang.Class<V> valueClass)
Constructs a value model indicating the type of value it can hold. |
|
DefaultValueModel(java.lang.Class<V> valueClass,
V defaultValue)
Constructs a value model indicating the type of value it can hold, along with an initial value. |
|
| Method Summary | |
|---|---|
void |
clearValue()
Clears the value by setting the value to null, which may be invalid according to any installed validators. |
V |
getDefaultValue()
|
V |
getValue()
|
void |
resetValue()
Resets the value to a default value, which may be invalid according to any installed validators. |
void |
setValue(V newValue)
Sets the new value. |
| Methods inherited from class com.guiseframework.model.AbstractValueModel |
|---|
createPropertyVetoException, getValidator, getValueClass, isValidValue, setValidator, validateValue |
| Methods inherited from class com.guiseframework.model.AbstractModel |
|---|
getEventListenerManager, getPlainText |
| Methods inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.globalmentor.beans.PropertyBindable |
|---|
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener |
| Methods inherited from interface com.globalmentor.beans.PropertyConstrainable |
|---|
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, hasVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener |
| Constructor Detail |
|---|
public DefaultValueModel(java.lang.Class<V> valueClass)
null.
valueClass - The class indicating the type of value held in the model.
java.lang.NullPointerException - if the given value class is null.
public DefaultValueModel(java.lang.Class<V> valueClass,
V defaultValue)
valueClass - The class indicating the type of value held in the model.defaultValue - The default value, which will not be validated.
java.lang.NullPointerException - if the given value class is null.| Method Detail |
|---|
public V getDefaultValue()
public V getValue()
null if there is no input value.
public void setValue(V newValue)
throws java.beans.PropertyVetoException
equals() method.
If a validator is installed, the value will first be validated before the current value is changed.
Validation always occurs if a validator is installed, even if the value is not changing.
If the value change is vetoed by the installed validator, the validation exception will be accessible via Throwable.getCause().
newValue - The new value.
java.beans.PropertyVetoException - if the provided value is not valid or the change has otherwise been vetoed.AbstractValueModel.getValidator(),
ValueModel.VALUE_PROPERTYpublic void clearValue()
null, which may be invalid according to any installed validators.
No validation occurs.
ValueModel.VALUE_PROPERTYpublic void resetValue()
ValueModel.VALUE_PROPERTY
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||