|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.binding.value.support.AbstractValueModelWrapper
org.springframework.binding.value.support.TypeConverter
public class TypeConverter
A value model wrapper that supports converting the wrapped value to and from another type using the supplied conversion Closures.
| Field Summary |
|---|
| Fields inherited from interface org.springframework.binding.value.ValueModel |
|---|
VALUE_PROPERTY |
| Constructor Summary | |
|---|---|
TypeConverter(ValueModel wrappedModel,
Closure convertTo,
Closure convertFrom)
Constructor which uses Closure blocks to convert between values. |
|
TypeConverter(ValueModel wrappedModel,
org.springframework.binding.convert.ConversionExecutor convertTo,
org.springframework.binding.convert.ConversionExecutor convertFrom)
Convenience constructor using conversionExecutors. |
|
| Method Summary | |
|---|---|
ValueModel[] |
getSourceValueModels()
Returns an array of all values models that are used to derive the value represented by this value model. |
Object |
getValue()
Returns this model's value. |
protected ValueChangeDetector |
getValueChangeDetector()
|
boolean |
isReadOnly()
Returns true if the implementation does not support calls setValue. |
void |
setValueChangeDetector(ValueChangeDetector valueChangeDetector)
|
void |
setValueSilently(Object value,
PropertyChangeListener listenerToSkip)
Sets a new value and if the value has changed notifies all registered value change listeners except for the specified listener to skip. |
| Methods inherited from class org.springframework.binding.value.support.AbstractValueModelWrapper |
|---|
addValueChangeListener, getInnerMostValue, getInnerMostWrappedValueModel, getWrappedValueModel, removeValueChangeListener, setValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.springframework.binding.value.ValueModel |
|---|
addValueChangeListener, removeValueChangeListener, setValue |
| Constructor Detail |
|---|
public TypeConverter(ValueModel wrappedModel,
org.springframework.binding.convert.ConversionExecutor convertTo,
org.springframework.binding.convert.ConversionExecutor convertFrom)
wrappedModel - the inner valueModelconvertTo - conversion to use when setting a value.convertFrom - conversion to use when getting a value.TypeConverter(ValueModel, Closure, Closure)
public TypeConverter(ValueModel wrappedModel,
Closure convertTo,
Closure convertFrom)
wrappedModel - the inner valueModelconvertTo - Closure to execute when setting a value.convertFrom - Closure to execute when getting a value.| Method Detail |
|---|
public Object getValue()
throws IllegalArgumentException
null or any other appropriate value.
Value from inner model will be converted using the supplied convertFrom closure.
getValue in interface ValueModelgetValue in class AbstractValueModelWrapperIllegalArgumentException
public void setValueSilently(Object value,
PropertyChangeListener listenerToSkip)
throws IllegalArgumentException
ValueModel
setValueSilently in interface ValueModelsetValueSilently in class AbstractValueModelWrappervalue - the value to be setlistenerToSkip - the PropertyChangeListener that should
not be notified of this change (may be null).
IllegalArgumentExceptionpublic ValueModel[] getSourceValueModels()
DerivedValueModel
getSourceValueModels in interface DerivedValueModelpublic boolean isReadOnly()
DerivedValueModel
isReadOnly in interface DerivedValueModelpublic void setValueChangeDetector(ValueChangeDetector valueChangeDetector)
protected ValueChangeDetector getValueChangeDetector()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||