public class StringTypeHandler extends Object implements TypeHandler
NIL
Constructor and Description |
---|
StringTypeHandler() |
Modifier and Type | Method and Description |
---|---|
String |
format(Object value)
Formats the value by calling
Object.toString() . |
Class<?> |
getType()
Returns the class type supported by this handler.
|
boolean |
isNullIfEmpty()
Returns true if empty string values are parsed as null.
|
boolean |
isTrim()
Returns true if parse(String) should trim the text.
|
String |
parse(String text)
Parses a String from the given text.
|
void |
setNullIfEmpty(boolean nullIfEmpty)
Set to true if the parsed empty strings should be converted to null.
|
void |
setTrim(boolean trim)
Set to true to trim text when parsing.
|
public String parse(String text)
parse
in interface TypeHandler
text
- the text to parsepublic String format(Object value)
Object.toString()
.format
in interface TypeHandler
value
- the value to formatpublic Class<?> getType()
TypeHandler
getType
in interface TypeHandler
public boolean isTrim()
public void setTrim(boolean trim)
trim
- true if text should be trimmed when parsedpublic boolean isNullIfEmpty()
public void setNullIfEmpty(boolean nullIfEmpty)
nullIfEmpty
- true to convert empty string to null