public class XMLDateTimeParser extends java.lang.Object implements ValueParser<java.util.Date>
Date. The format of the
string should follow the XML schema DateTime specification. A
NullPointerException is thrown if the string provided is
null.| Modifier and Type | Field and Description |
|---|---|
static XMLDateTimeParser |
PARSER
Useful static instance of this object to be used when one doesn't want to
generate lots of parsers when one will suffice
|
| Constructor and Description |
|---|
XMLDateTimeParser() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
format(java.util.Date value)
Format a value as a string.
|
java.lang.Class<java.util.Date> |
getType()
Returns the
Class of object this ValueParser can handle. |
java.util.Date |
parse(java.lang.String valueString)
Parses the specified string and constructs the appropriate object out of
it.
|
public static final XMLDateTimeParser PARSER
public java.lang.Class<java.util.Date> getType()
ValueParserClass of object this ValueParser can handle.
The ValueParser.parse(String) method must return objects that are assignable to this type.
The #format(T) method can format any object assignable to this type.
The returned class will be the
exact Class (i.e. not a subclass) of this
ValueParser's typegetType in interface ValueFormatter<java.util.Date>getType in interface ValueParser<java.util.Date>ValueParserpublic java.util.Date parse(java.lang.String valueString)
throws java.lang.IllegalArgumentException,
java.lang.NullPointerException
ValueParserparse in interface ValueParser<java.util.Date>java.lang.IllegalArgumentExceptionjava.lang.NullPointerExceptionvalueString - The string to parsevalueStringpublic java.lang.String format(java.util.Date value)
ValueParserformat in interface ValueFormatter<java.util.Date>format in interface ValueParser<java.util.Date>value - The object to format