|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.data.util.converter.ConverterUtil
public class ConverterUtil
| Constructor Summary | |
|---|---|
ConverterUtil()
|
|
| Method Summary | ||
|---|---|---|
static boolean |
canConverterHandle(Converter<?,?> converter,
java.lang.Class<?> presentationType,
java.lang.Class<?> modelType)
Checks if the given converter can handle conversion between the given presentation and model type. |
|
static boolean |
canConverterPossiblyHandle(Converter<?,?> converter,
java.lang.Class<?> presentationType,
java.lang.Class<?> modelType)
Checks if it possible that the given converter can handle conversion between the given presentation and model type somehow. |
|
static
|
convertFromModel(MODELTYPE modelValue,
java.lang.Class<? extends PRESENTATIONTYPE> presentationType,
Converter<PRESENTATIONTYPE,MODELTYPE> converter,
java.util.Locale locale)
Convert the given value from the data source type to the UI type. |
|
static
|
convertToModel(PRESENTATIONTYPE presentationValue,
java.lang.Class<MODELTYPE> modelType,
Converter<PRESENTATIONTYPE,MODELTYPE> converter,
java.util.Locale locale)
Convert the given value from the presentation (UI) type to model (data source) type. |
|
static
|
getConverter(java.lang.Class<PRESENTATIONTYPE> presentationType,
java.lang.Class<MODELTYPE> modelType,
VaadinSession session)
Finds a converter that can convert from the given presentation type to the given model type and back. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConverterUtil()
| Method Detail |
|---|
public static <PRESENTATIONTYPE,MODELTYPE> Converter<PRESENTATIONTYPE,MODELTYPE> getConverter(java.lang.Class<PRESENTATIONTYPE> presentationType,
java.lang.Class<MODELTYPE> modelType,
VaadinSession session)
ConverterFactory or, if application is null, uses the
VaadinSession.getCurrent().
PRESENTATIONTYPE - the presentation typeMODELTYPE - the model typepresentationType - the presentation typemodelType - the model typesession - the session to use to find a ConverterFactory or null to use
the current session
public static <PRESENTATIONTYPE,MODELTYPE> PRESENTATIONTYPE convertFromModel(MODELTYPE modelValue,
java.lang.Class<? extends PRESENTATIONTYPE> presentationType,
Converter<PRESENTATIONTYPE,MODELTYPE> converter,
java.util.Locale locale)
throws Converter.ConversionException
PRESENTATIONTYPE - the presentation typeMODELTYPE - the model typemodelValue - the model value to convertpresentationType - the type of the presentation valueconverter - the converter to uselocale - the locale to use for conversion
Converter.ConversionException - if there was a problem converting the value
public static <MODELTYPE,PRESENTATIONTYPE> MODELTYPE convertToModel(PRESENTATIONTYPE presentationValue,
java.lang.Class<MODELTYPE> modelType,
Converter<PRESENTATIONTYPE,MODELTYPE> converter,
java.util.Locale locale)
throws Converter.ConversionException
PRESENTATIONTYPE - the presentation typeMODELTYPE - the model typepresentationValue - the presentation value to convertmodelType - the type of the modelconverter - the converter to uselocale - the locale to use for conversion
Converter.ConversionException - if there was a problem converting the value
public static boolean canConverterHandle(Converter<?,?> converter,
java.lang.Class<?> presentationType,
java.lang.Class<?> modelType)
converter - The converter to check. If this is null the result is always
false.presentationType - The presentation typemodelType - The model type
canConverterPossiblyHandle(Converter, Class, Class)
public static boolean canConverterPossiblyHandle(Converter<?,?> converter,
java.lang.Class<?> presentationType,
java.lang.Class<?> modelType)
converter - The converter to check. If this is null the result is always
false.presentationType - The presentation typemodelType - The model type
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||