|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jibx.runtime.JodaConvert
public abstract class JodaConvert
Utility class supplying static methods for Joda date/time conversions. The actual serializer/deserializer methods are all public so that they'll be included in JavaDocs; support methods are protected, so that they'll be exposed for user classes extending this class.
Constructor Summary | |
---|---|
JodaConvert()
|
Method Summary | |
---|---|
protected static DateMidnight |
deserializeDateMidnight(java.lang.String text,
DateTimeZone zone)
Deserialize date value as a midnight date in the specified time zone. |
static LocalDate |
deserializeLocalDate(java.lang.String text)
Deserialize date value from text as local date without time zone. |
static DateMidnight |
deserializeLocalDateMidnight(java.lang.String text)
Deserialize date value from text as midnight date in default (local) time zone. |
static DateTime |
deserializeLocalDateTime(java.lang.String text)
Deserialize date/time value from text into the local (default) time zone. |
static LocalTime |
deserializeLocalTime(java.lang.String text)
Deserialize time value from text as local time. |
static DateTime |
deserializeStrictLocalDateTime(java.lang.String text)
Deserialize local (default zone) date/time value from text with time zone required. |
static DateTime |
deserializeStrictUTCDateTime(java.lang.String text)
Deserialize UTC date/time value from text with time zone required. |
static DateMidnight |
deserializeUTCDateMidnight(java.lang.String text)
Deserialize date value from text as midnight date in UTC time zone. |
static DateTime |
deserializeUTCDateTime(java.lang.String text)
Deserialize UTC date/time value from text into the UTC time zone. |
static DateMidnight |
deserializeZonedDateMidnight(java.lang.String text)
Deserialize date value from text as midnight date in specified (or default) time zone. |
static DateTime |
deserializeZonedDateTime(java.lang.String text)
Deserialize date/time value from text in specified (or default) time zone. |
protected static DateTimeZone |
findZone(java.lang.String text,
DateTimeZone dflt)
Find the date/time zone for an xs:date or xs:dateTime text representation. |
protected static DateTime |
parseDateTime(java.lang.String text,
boolean full,
DateTimeZone zone)
Parse date/time value from text. |
static java.lang.String |
serializeLocalDate(LocalDate date)
Serialize local date value to general date text without time zone. |
static java.lang.String |
serializeUnzonedDateMidnight(DateMidnight date)
Serialize midnight date value to general date text without time zone. |
static java.lang.String |
serializeUnzonedLocalTime(LocalTime time)
Serialize local time value to general date text without time zone. |
static java.lang.String |
serializeUTCDateMidnight(DateMidnight date)
Serialize midnight date value to general date text with UTC time zone. |
static java.lang.String |
serializeUTCDateTime(DateTime time)
Serialize date/time to general dateTime text. |
static java.lang.String |
serializeUTCLocalTime(LocalTime time)
Serialize local time value to general date text with UTC time zone. |
static java.lang.String |
serializeZonedDateMidnight(DateMidnight date)
Serialize midnight date value to general date text with time zone offset. |
static java.lang.String |
serializeZonedDateTime(DateTime time)
Serialize date/time to general dateTime text. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JodaConvert()
Method Detail |
---|
public static LocalDate deserializeLocalDate(java.lang.String text) throws JiBXException
null
input.
text
- text to be parsed (may be null
)
null
if passed null
input
JiBXException
- on parse errorpublic static java.lang.String serializeLocalDate(LocalDate date)
date
- date to be converted
protected static DateMidnight deserializeDateMidnight(java.lang.String text, DateTimeZone zone) throws JiBXException
text
- zone
-
JiBXException
protected static DateTimeZone findZone(java.lang.String text, DateTimeZone dflt) throws JiBXException
text
- xs:date or xs:dateTime valuedflt
- default zone to be returned if no zone specified
JiBXException
public static DateMidnight deserializeZonedDateMidnight(java.lang.String text) throws JiBXException
null
input.
text
- text to be parsed (may be null
)
null
if passed null
input
JiBXException
- on parse errorpublic static DateMidnight deserializeLocalDateMidnight(java.lang.String text) throws JiBXException
null
input.
text
- text to be parsed (may be null
)
null
if passed null
input
JiBXException
- on parse errorpublic static DateMidnight deserializeUTCDateMidnight(java.lang.String text) throws JiBXException
null
input.
text
- text to be parsed (may be null
)
null
if passed null
input
JiBXException
- on parse errorpublic static java.lang.String serializeUnzonedDateMidnight(DateMidnight date)
date
- date to be converted
public static java.lang.String serializeZonedDateMidnight(DateMidnight date)
date
- date to be converted
public static java.lang.String serializeUTCDateMidnight(DateMidnight date)
date
- date to be converted
public static LocalTime deserializeLocalTime(java.lang.String text) throws JiBXException
null
input.
text
- text to be parsed (may be null
)
null
if passed null
input
JiBXException
- on parse errorpublic static java.lang.String serializeUnzonedLocalTime(LocalTime time)
time
- time to be converted
public static java.lang.String serializeUTCLocalTime(LocalTime time)
time
- time to be converted
protected static DateTime parseDateTime(java.lang.String text, boolean full, DateTimeZone zone) throws JiBXException
text
- full
- zoned time required flag (exception thrown if missing)zone
- time zone used for returned date/time
JiBXException
public static DateTime deserializeZonedDateTime(java.lang.String text) throws JiBXException
null
input.
text
- text to be parsed (may be null
)
null
if passed null
input
JiBXException
- on parse errorpublic static DateTime deserializeUTCDateTime(java.lang.String text) throws JiBXException
null
input.
text
- text to be parsed (may be null
)
null
if passed null
input
JiBXException
- on parse errorpublic static DateTime deserializeLocalDateTime(java.lang.String text) throws JiBXException
null
input.
text
- text to be parsed (may be null
)
null
if passed null
input
JiBXException
- on parse errorpublic static DateTime deserializeStrictUTCDateTime(java.lang.String text) throws JiBXException
null
input.
text
- text to be parsed (may be null
)
null
if passed null
input
JiBXException
- on parse errorpublic static DateTime deserializeStrictLocalDateTime(java.lang.String text) throws JiBXException
null
input.
text
- text to be parsed (may be null
)
null
if passed null
input
JiBXException
- on parse errorpublic static java.lang.String serializeZonedDateTime(DateTime time)
time
- date/time to be converted
public static java.lang.String serializeUTCDateTime(DateTime time)
time
- date/time to be converted
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |