public class XmlBooleanTypeHandler extends Object implements TypeHandler
NIL
Constructor and Description |
---|
XmlBooleanTypeHandler()
Constructs a new XmlBooleanTypeHandler.
|
Modifier and Type | Method and Description |
---|---|
String |
format(Object value)
Returns
Boolean.toString() , or null if value
is null. |
Class<?> |
getType()
Returns the class type supported by this handler.
|
boolean |
isNumericFormatEnabled()
Returns whether the numeric format of a XML boolean is used to format
Java Boolean types.
|
Boolean |
parse(String text)
Parses a Boolean object from the given text.
|
void |
setNumericFormatEnabled(boolean numericFormatEnabled)
Sets whether the numeric format of a XML boolean is used to format Java
Boolean types.
|
public XmlBooleanTypeHandler()
public Boolean parse(String text) throws TypeConversionException
parse
in interface TypeHandler
text
- the text to parseTypeConversionException
- if the text cannot be parsedpublic String format(Object value)
Boolean.toString()
, or null if value
is null.format
in interface TypeHandler
value
- the Java object to format, which may be nullTypeHandler.NIL
for XML formatted streamspublic Class<?> getType()
TypeHandler
getType
in interface TypeHandler
public boolean isNumericFormatEnabled()
public void setNumericFormatEnabled(boolean numericFormatEnabled)
numericFormatEnabled
- true if a Boolean is formatted using 0
and 1 instead of 'true' and 'false'