|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.data.util.converter.ReverseConverter<PRESENTATION,MODEL>
MODEL
- The source typePRESENTATION
- The target typepublic class ReverseConverter<PRESENTATION,MODEL>
A converter that wraps another Converter
and reverses source and
target types.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.vaadin.data.util.converter.Converter |
---|
Converter.ConversionException |
Constructor Summary | |
---|---|
ReverseConverter(Converter<MODEL,PRESENTATION> converter)
Creates a converter from source to target based on a converter that converts from target to source. |
Method Summary | |
---|---|
MODEL |
convertToModel(PRESENTATION value,
java.lang.Class<? extends MODEL> targetType,
java.util.Locale locale)
Converts the given value from target type to source type. |
PRESENTATION |
convertToPresentation(MODEL value,
java.lang.Class<? extends PRESENTATION> targetType,
java.util.Locale locale)
Converts the given value from source type to target type. |
java.lang.Class<MODEL> |
getModelType()
The source type of the converter. |
java.lang.Class<PRESENTATION> |
getPresentationType()
The target type of the converter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReverseConverter(Converter<MODEL,PRESENTATION> converter)
converter
- The converter to use in a reverse fashionMethod Detail |
---|
public MODEL convertToModel(PRESENTATION value, java.lang.Class<? extends MODEL> targetType, java.util.Locale locale) throws Converter.ConversionException
Converter
A converter can optionally use locale to do the conversion.
A converter should in most cases be symmetric so chainingConverter.convertToPresentation(Object, Class, Locale)
and
Converter.convertToModel(Object, Class, Locale)
should return the original
value.
convertToModel
in interface Converter<PRESENTATION,MODEL>
value
- The value to convert, compatible with the target type. Can be
nulltargetType
- The requested type of the return valuelocale
- The locale to use for conversion. Can be null.
Converter.ConversionException
- If the value could not be convertedpublic PRESENTATION convertToPresentation(MODEL value, java.lang.Class<? extends PRESENTATION> targetType, java.util.Locale locale) throws Converter.ConversionException
Converter
A converter can optionally use locale to do the conversion.
A converter should in most cases be symmetric so chainingConverter.convertToPresentation(Object, Class, Locale)
and
Converter.convertToModel(Object, Class, Locale)
should return the original
value.
convertToPresentation
in interface Converter<PRESENTATION,MODEL>
value
- The value to convert, compatible with the target type. Can be
nulltargetType
- The requested type of the return valuelocale
- The locale to use for conversion. Can be null.
Converter.ConversionException
- If the value could not be convertedpublic java.lang.Class<MODEL> getModelType()
Converter
Converter.convertToPresentation(Object, Class, Locale)
.
getModelType
in interface Converter<PRESENTATION,MODEL>
public java.lang.Class<PRESENTATION> getPresentationType()
Converter
Converter.convertToModel(Object, Class, Locale)
.
getPresentationType
in interface Converter<PRESENTATION,MODEL>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |