public class DatatypeUtils
extends java.lang.Object
| Constructor and Description |
|---|
DatatypeUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
formatAsXSDateTime(java.util.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 java.util.Date |
parseXSDateTime(java.lang.String lexicalRepresentation)
Create a new Date by parsing the String as a lexical representation.
|
public static java.lang.String formatAsXSDateTime(java.util.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 XMLGregorianCalendarjava.lang.IllegalStateException - if the combination of set fields does not match one of the eight defined XML Schema
builtin date/time datatypes.public static java.util.Date parseXSDateTime(java.lang.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.java.lang.IllegalArgumentException - If the lexicalRepresentation is not a valid
XMLGregorianCalendar.java.lang.NullPointerException - If lexicalRepresentation is null.Copyright © 2019. All Rights Reserved.