public final class DOMTypeSupport
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.util.Calendar |
baseline
Baseline for duration calculations (comes from XML Schema standard).
|
private static javax.xml.datatype.DatatypeFactory |
dataTypeFactory
JAXP DatatypeFactory.
|
| Modifier | Constructor and Description |
|---|---|
private |
DOMTypeSupport()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static long |
dateTimeToLong(java.lang.String dateTime)
Converts a lexical dateTime, as defined by XML Schema 1.0, into milliseconds since the epoch.
|
static long |
durationToLong(javax.xml.datatype.Duration duration)
Converts a lexical duration, as defined by XML Schema 1.0, into milliseconds.
|
static long |
durationToLong(java.lang.String duration)
Converts a lexical duration, as defined by XML Schema 1.0, into milliseconds.
|
static javax.xml.datatype.DatatypeFactory |
getDataTypeFactory()
Gets a static instance of a JAXP DatatypeFactory.
|
static javax.xml.namespace.QName |
getXSIType(org.w3c.dom.Element e)
Gets the XSI type for a given element if it has one.
|
static boolean |
hasXSIType(org.w3c.dom.Element e)
Checks if the given element has an xsi:type defined for it.
|
static java.lang.String |
longToDateTime(long dateTime)
Converts a numerical date/time, given in milliseconds since the epoch, to a lexical dateTime defined by XML
Schema 1.0.
|
static java.lang.String |
longToDuration(long duration)
Converts a duration in milliseconds to a lexical duration, as defined by XML Schema 1.0.
|
private static javax.xml.datatype.DatatypeFactory dataTypeFactory
private static java.util.Calendar baseline
public static long dateTimeToLong(@Nonnull
java.lang.String dateTime)
dateTime - lexical date/time, may not be nullpublic static long durationToLong(java.lang.String duration)
duration - lexical duration representationpublic static long durationToLong(javax.xml.datatype.Duration duration)
duration - JAXP duration representationpublic static javax.xml.datatype.DatatypeFactory getDataTypeFactory()
@Nullable
public static javax.xml.namespace.QName getXSIType(@Nullable
org.w3c.dom.Element e)
e - the elementpublic static boolean hasXSIType(@Nullable
org.w3c.dom.Element e)
e - the DOM element@Nonnull public static java.lang.String longToDateTime(long dateTime)
dateTime - the date time to be converted@Nonnull public static java.lang.String longToDuration(long duration)
duration - the duration