|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Objectorg.exist.fluent.DataUtils
public class DataUtils
A bunch of static data conversion utility methods.
| Field Summary | |
|---|---|
static Comparator<XMLGregorianCalendar> |
DATE_TIME_COMPARATOR
A comparator for dateTimes (XMLGregorianCalendar objects), that uses the partial order defined on dateTimes and throws an exception if the order is indeterminate. |
| Method Summary | |
|---|---|
static DatatypeFactory |
datatypeFactory()
Return a shared instance of a datatype factory, used for creating new XML data objects. |
static Date |
toDate(XMLGregorianCalendar dateTime)
Convert an XML date/time to its java.util.Date equivalent. |
static XMLGregorianCalendar |
toDateTime(Date date)
Convert a Java date to its XML date/time equivalent. |
static XMLGregorianCalendar |
toDateTime(long millis)
Convert milliseconds offset to its XML date/time equivalent. |
static Object |
toXMLObject(Object o)
Convert a Java object to its equivalent XML datatype representation. |
static String |
toXMLString(Object o)
Convert a Java object to its equivalent XML datatype string representation. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Comparator<XMLGregorianCalendar> DATE_TIME_COMPARATOR
| Method Detail |
|---|
public static DatatypeFactory datatypeFactory()
public static Date toDate(XMLGregorianCalendar dateTime)
java.util.Date equivalent.
dateTime - the XML date/time to convert
public static XMLGregorianCalendar toDateTime(Date date)
date - the Java date to convert
public static XMLGregorianCalendar toDateTime(long millis)
millis - a millisecond count since the epoch
public static String toXMLString(Object o)
java.util.Date,
java.util.Calendar and byte[] (Base64 encoding);
for all other objects, we simply invoke toString().
o - the object to convert
public static Object toXMLObject(Object o)
java.util.Date,
java.util.Calendar and byte[] (Base64 encoding);
all other objects are simply passed through as-is.
o - the object to convert
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||