|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vaadin.data.util.converter.StringToBooleanConverter
public class StringToBooleanConverter
A converter that converts from String
to Boolean
and back.
The String representation is given by Boolean.toString().
Leading and trailing white spaces are ignored when converting from a String.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.vaadin.data.util.converter.Converter |
---|
Converter.ConversionException |
Constructor Summary | |
---|---|
StringToBooleanConverter()
|
Method Summary | |
---|---|
Boolean |
convertToModel(String value,
Locale locale)
Converts the given value from target type to source type. |
String |
convertToPresentation(Boolean value,
Locale locale)
Converts the given value from source type to target type. |
protected String |
getFalseString()
Gets the string representation for false. |
Class<Boolean> |
getModelType()
The source type of the converter. |
Class<String> |
getPresentationType()
The target type of the converter. |
protected String |
getTrueString()
Gets the string representation for true. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringToBooleanConverter()
Method Detail |
---|
public Boolean convertToModel(String value, 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, Locale)
and
Converter.convertToModel(Object, Locale)
should return the original value.
convertToModel
in interface Converter<String,Boolean>
value
- The value to convert, compatible with the target type. Can be
nulllocale
- The locale to use for conversion. Can be null.
Converter.ConversionException
- If the value could not be convertedprotected String getTrueString()
protected String getFalseString()
public String convertToPresentation(Boolean value, 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, Locale)
and
Converter.convertToModel(Object, Locale)
should return the original value.
convertToPresentation
in interface Converter<String,Boolean>
value
- The value to convert, compatible with the target type. Can be
nulllocale
- The locale to use for conversion. Can be null.
Converter.ConversionException
- If the value could not be convertedpublic Class<Boolean> getModelType()
Converter
Converter.convertToPresentation(Object, Locale)
.
getModelType
in interface Converter<String,Boolean>
public Class<String> getPresentationType()
Converter
Converter.convertToModel(Object, Locale)
.
getPresentationType
in interface Converter<String,Boolean>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |