org.springframework.binding.value.support
Class MessageFormatValueModel
java.lang.Object
org.springframework.binding.value.support.AbstractPropertyChangePublisher
org.springframework.binding.value.support.AbstractValueModel
org.springframework.binding.value.support.AbstractDerivedValueModel
org.springframework.binding.value.support.MessageFormatValueModel
- All Implemented Interfaces:
- DerivedValueModel, PropertyChangePublisher, ValueModel
public class MessageFormatValueModel
- extends AbstractDerivedValueModel
A value model that takes a set of "argument" ValueModels, formats their
values into strings, and then inserts these formatted strings into the
provided pattern at the appropriate places. Any changes to the "argument"
ValueModels will cause this value model to also update.
- Author:
- Oliver Hutchison
- See Also:
MessageFormat
Method Summary |
Object |
getValue()
Returns this model's value. |
protected void |
sourceValuesChanged()
Derive the value from the source values and fire a valueChangeEvent to
notify listeners. |
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 org.springframework.binding.value.support.AbstractPropertyChangePublisher |
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, firePropertiesChanged, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasChanged, hasChanged, hasChanged, hasChanged, hasChanged, hasChanged, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MessageFormatValueModel
public MessageFormatValueModel(String pattern,
ValueModel argumentValueModel)
- Constructs a new MessageFormatValueModel with a single argument.
- Parameters:
pattern
- the patternargumentValueModel
- the single value model holding the
value to be formatted and substituted
MessageFormatValueModel
public MessageFormatValueModel(String pattern,
ValueModel[] argumentValueModels)
- Constructs a new MessageFormatValueModel with a group of arguments.
- Parameters:
pattern
- the patternargumentValueModels
- an array of value models holding the
value to be formatted and substituted
sourceValuesChanged
protected void sourceValuesChanged()
- Description copied from class:
AbstractDerivedValueModel
- Derive the value from the source values and fire a valueChangeEvent to
notify listeners.
- Specified by:
sourceValuesChanged
in class AbstractDerivedValueModel
getValue
public Object getValue()
- Description copied from interface:
ValueModel
- Returns this model's value. In case of a write-only value,
implementers may choose to either reject this operation or
or return
null
or any other appropriate value.
- Returns:
- this model's value
Copyright © 2004-2008 The Spring Framework. All Rights Reserved.