|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.opensagres.xdocreport.core.utils.DatatypeUtils
public class DatatypeUtils
Constructor Summary | |
---|---|
DatatypeUtils()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DatatypeUtils()
Method Detail |
---|
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 XMLGregorianCalendar
IllegalStateException
- 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
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |