TypeConversionHandlerpublic class DateConversionHandler extends Object implements TypeConversionHandler
| Modifier and Type | Field | Description |
|---|---|---|
static DateConversionHandler |
INSTANCE |
| Constructor | Description |
|---|---|
DateConversionHandler() |
Constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
String[] |
getParsingFormats() |
Returns the formats that will be used.
|
DateFormat[] |
getParsingFormatters() |
Returns the date formatters created from our date formatters.
|
protected DateFormat[] |
getParsingFormatters(String s) |
Returns date formatters that fit the given string.
|
String |
getPrintFormat() |
Returns the printing format.
|
DateFormat |
getPrintFormatter() |
Returns the print formatter created from the print format.
|
TimeZone |
getTimezone() |
Returns the timezone this handler uses.
|
String[] |
getTypes() |
Returns th type java.util.Date.
|
protected boolean |
matches(String format,
String s) |
|
void |
setParsingFormats(String[] parsingFormats) |
Sets the parsing date formats to be used.
|
void |
setPrintFormat(String printFormat) |
Sets the format used for printing.
|
void |
setTimezone(TimeZone timezone) |
Sets the timezone for formatting and parsing.
|
Object |
toObject(String s) |
Converts string to date.
|
String |
toString(Object o) |
Converts the date to its string representation.
|
public static final DateConversionHandler INSTANCE
public String[] getTypes()
getTypes in interface TypeConversionHandlerTypeConversionHandler.getTypes()public Object toObject(String s)
toObject in interface TypeConversionHandlers - string to be parsedTypeConversionHandler.toObject(java.lang.String)public String toString(Object o)
toString in interface TypeConversionHandlero - date to be convertedTypeConversionHandler.toString(java.lang.Object)public DateFormat[] getParsingFormatters()
protected DateFormat[] getParsingFormatters(String s)
s - the string to analyzepublic String[] getParsingFormats()
public void setParsingFormats(String[] parsingFormats)
parsingFormats - the parsingFormats to setpublic String getPrintFormat()
public void setPrintFormat(String printFormat)
printFormat - the printFormat to setpublic DateFormat getPrintFormatter()
public void setTimezone(TimeZone timezone)
timezone - timezone to be used.public TimeZone getTimezone()
Copyright © 2018. All rights reserved.