|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jsefa.common.converter.BooleanConverter
public class BooleanConverter
Converter for Boolean objects.
The format consists of two Strings. The first token is the literal for true and the second the literal for
false.
It is thread-safe.
| Field Summary | |
|---|---|
protected static String[] |
FORMAT_BINARY
Format String with "1" for true and "0" for false. |
protected static String[] |
FORMAT_TRUE_FALSE
Format String with "true" for true and "false" for false. |
protected static String[] |
FORMAT_YES_NO
Format String with "yes" for true and "no" for false. |
| Constructor Summary | |
|---|---|
protected |
BooleanConverter(SimpleTypeConverterConfiguration configuration)
Constructs a new BooleanConverter. |
| Method Summary | |
|---|---|
static BooleanConverter |
create(SimpleTypeConverterConfiguration configuration)
Creates a new BooleanConverter. |
Boolean |
fromString(String value)
Converts the given String object into an object with the simple data type this converter is
intended for. |
protected String[] |
getDefaultFormat()
Returns the default format which is used when no format is given. |
String |
toString(Object value)
Converts the given value to a String object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String[] FORMAT_TRUE_FALSE
String with "true" for true and "false" for false.
protected static final String[] FORMAT_YES_NO
String with "yes" for true and "no" for false.
protected static final String[] FORMAT_BINARY
String with "1" for true and "0" for false.
| Constructor Detail |
|---|
protected BooleanConverter(SimpleTypeConverterConfiguration configuration)
BooleanConverter.getDefaultFormat()) is used.
configuration - the configuration.
ConversionException - if the given format is not valid.| Method Detail |
|---|
public static BooleanConverter create(SimpleTypeConverterConfiguration configuration)
BooleanConverter.getDefaultFormat()) is used.
configuration - the configuration.
ConversionException - if the given format is not valid.public final Boolean fromString(String value)
String object into an object with the simple data type this converter is
intended for.
fromString in interface SimpleTypeConvertervalue - the String object to convert
public final String toString(Object value)
String object.
toString in interface SimpleTypeConvertervalue - the value to convert
protected String[] getDefaultFormat()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||