public class DatatypeUtils extends Object
| Constructor and Description |
|---|
DatatypeUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
formatAsXSDateTime(Date date)
Return the lexical representation of the given Date The format is specified in XML Schema 1.0 Part 2, Section 3.2.[7-14].1, Lexical
Representation".
|
static Date |
parseXSDateTime(String lexicalRepresentation)
Create a new Date by parsing the String as a lexical representation.
|
public static String formatAsXSDateTime(Date date)
Return the lexical representation of the given Date The format is specified in XML Schema 1.0 Part 2, Section 3.2.[7-14].1, Lexical Representation".
Specific target lexical representation format is determined by #getXMLSchemaType().
String, representation of this XMLGregorianCalendarIllegalStateException - if the combination of set fields does not match one of the eight defined XML Schema
builtin date/time datatypes.public static Date parseXSDateTime(String lexicalRepresentation)
Create a new Date by parsing the String as a lexical representation.
Parsing the lexical string representation is defined in XML Schema 1.0 Part 2, Section 3.2.[7-14].1, Lexical Representation.
The string representation may not have any leading and trailing whitespaces.
The parsing is done field by field so that the following holds for any lexically correct String x:
newXMLGregorianCalendar( x ).toXMLFormat().equals( x )
Except for the noted lexical/canonical representation mismatches listed in XML Schema 1.0 errata, Section 3.2.7.2.
lexicalRepresentation - Lexical representation of one the eight XML Schema date/time datatypes.XMLGregorianCalendar created from the lexicalRepresentation.IllegalArgumentException - If the lexicalRepresentation is not a valid
XMLGregorianCalendar.NullPointerException - If lexicalRepresentation is null.Copyright © 2015. All Rights Reserved.