public class BooleanConverter extends DefaultObjectConverter<java.lang.Boolean>
ObjectConverter implementation for <code>Boolean</code> (and boolean primitive) values. The toString(Boolean, ConverterContext) will return a localized boolean text. The fromString(String,
ConverterContext) will return true or false for both localized boolean text as well as the English version text
(such as "true" or "false").| Constructor and Description |
|---|
BooleanConverter() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Boolean |
fromString(java.lang.String string,
ConverterContext context)
Return null in most cases unless the generic type T is also a String.
|
protected java.lang.String |
getFalse()
Get the string to represent the false value.
|
protected java.lang.String |
getNull()
Get the string to represent the null value.
|
protected java.lang.String |
getTrue()
Get the string to represent the true value.
|
java.lang.String |
toString(java.lang.Boolean object,
ConverterContext context)
Converts the value to String.
|
fromString, getObjectConverterManager, toString, toStringConverterpublic java.lang.String toString(java.lang.Boolean object,
ConverterContext context)
DefaultObjectConvertertoString in interface ObjectConverter<java.lang.Boolean>toString in class DefaultObjectConverter<java.lang.Boolean>object - the value to be concerted.context - converter context to be usedpublic java.lang.Boolean fromString(java.lang.String string,
ConverterContext context)
DefaultObjectConverterfromString in interface ObjectConverter<java.lang.Boolean>fromString in class DefaultObjectConverter<java.lang.Boolean>string - the stringcontext - context to be convertedprotected java.lang.String getTrue()
protected java.lang.String getFalse()
protected java.lang.String getNull()