@Immutable public final class PDTXMLConverter extends Object
| Modifier and Type | Method and Description |
|---|---|
static XMLGregorianCalendar |
createNewCalendar() |
static GregorianCalendar |
getCalendar(Date aDate)
Get the passed date as
GregorianCalendar using the default time
zone. |
static GregorianCalendar |
getCalendarDefaultTimeZone(long nMillis)
Get the passed milliseconds as
GregorianCalendar. |
static GregorianCalendar |
getCalendarUTC(long nMillis)
Get the passed milliseconds as
GregorianCalendar. |
static DatatypeFactory |
getDatatypeFactory() |
static Date |
getDate(XMLGregorianCalendar aCal)
Get the passed
XMLGregorianCalendar as Date. |
static GregorianCalendar |
getGregorianCalendar(XMLGregorianCalendar aCal)
Convert the passed
XMLGregorianCalendar to a
GregorianCalendar. |
static LocalDate |
getLocalDate(XMLGregorianCalendar aCal)
Get the passed
XMLGregorianCalendar as LocalDate. |
static LocalDateTime |
getLocalDateTime(XMLGregorianCalendar aCal)
Get the passed
XMLGregorianCalendar as LocalDateTime. |
static LocalTime |
getLocalTime(XMLGregorianCalendar aCal)
Get the passed
XMLGregorianCalendar as LocalTime. |
static long |
getMillis(XMLGregorianCalendar aCal)
Get the passed
XMLGregorianCalendar as milliseconds. |
static int |
getTimezoneOffsetInMinutes(Calendar aCalendar)
Get the time zone offset to UTC of the passed calendar in minutes to be
used in
XMLGregorianCalendar. |
static int |
getTimezoneOffsetInMinutes(int nOffsetInMillis)
Convert milliseconds to minutes.
|
static XMLGregorianCalendar |
getXMLCalendar(Date aDate)
Get the passed
Date as XMLGregorianCalendar. |
static XMLGregorianCalendar |
getXMLCalendar(GregorianCalendar aCal)
Get the passed
GregorianCalendar as XMLGregorianCalendar. |
static XMLGregorianCalendar |
getXMLCalendar(LocalDateTime aBase)
Get the passed object as
XMLGregorianCalendar with date and time. |
static XMLGregorianCalendar |
getXMLCalendar(long nMillis)
Get the passed milliseconds as
XMLGregorianCalendar. |
static XMLGregorianCalendar |
getXMLCalendar(XMLGregorianCalendar aDate,
XMLGregorianCalendar aTime)
Create a new
XMLGregorianCalendar using separate objects for date
and time. |
static XMLGregorianCalendar |
getXMLCalendar(ZonedDateTime aBase)
Get the passed object as
XMLGregorianCalendar with date and time. |
static XMLGregorianCalendar |
getXMLCalendarDate(Date aBase)
Get the passed object as
XMLGregorianCalendar date (without a
time). |
static XMLGregorianCalendar |
getXMLCalendarDate(GregorianCalendar aBase)
Get the passed object as
XMLGregorianCalendar date (without a
time). |
static XMLGregorianCalendar |
getXMLCalendarDate(int nYear,
int nMonth,
int nDay)
Create a Java representation of XML Schema builtin datatype
date or g*. |
static XMLGregorianCalendar |
getXMLCalendarDate(int nYear,
int nMonth,
int nDay,
int nTimezone)
Create a Java representation of XML Schema builtin datatype
date or g*. |
static XMLGregorianCalendar |
getXMLCalendarDate(LocalDate aBase)
Get the passed object as
XMLGregorianCalendar date (without a
time). |
static XMLGregorianCalendar |
getXMLCalendarDate(LocalDate aBase,
int nTimezoneOffsetInMinutes)
Get the passed object as
XMLGregorianCalendar date (without a
time). |
static XMLGregorianCalendar |
getXMLCalendarDate(XMLGregorianCalendar aBase)
Get the passed object as
XMLGregorianCalendar date (without a
time). |
static XMLGregorianCalendar |
getXMLCalendarDateNow()
Get the current date as
XMLGregorianCalendar. |
static XMLGregorianCalendar |
getXMLCalendarNow()
Get the current date and time as
XMLGregorianCalendar in the
default time zone. |
static XMLGregorianCalendar |
getXMLCalendarNowUTC()
Get the current date and time as
XMLGregorianCalendar in UTC. |
static XMLGregorianCalendar |
getXMLCalendarTime(Date aBase)
Get the passed object as
XMLGregorianCalendar time (without a
date). |
static XMLGregorianCalendar |
getXMLCalendarTime(GregorianCalendar aBase)
Get the passed object as
XMLGregorianCalendar time (without a
date). |
static XMLGregorianCalendar |
getXMLCalendarTime(int nHour,
int nMinute,
int nSecond,
int nMilliSecond)
Create a Java representation of XML Schema builtin datatype
date or g*. |
static XMLGregorianCalendar |
getXMLCalendarTime(int nHour,
int nMinute,
int nSecond,
int nMilliSecond,
int nTimezone)
Create a Java representation of XML Schema builtin datatype
date or g*. |
static XMLGregorianCalendar |
getXMLCalendarTime(LocalTime aBase)
Get the passed object as
XMLGregorianCalendar time (without a
date). |
static XMLGregorianCalendar |
getXMLCalendarTime(XMLGregorianCalendar aBase)
Get the passed object as
XMLGregorianCalendar time (without a
date). |
static XMLGregorianCalendar |
getXMLCalendarTimeNow()
Get the current time as
XMLGregorianCalendar. |
static XMLGregorianCalendar |
getXMLCalendarUTC(long nMillis)
Get the passed milliseconds as
XMLGregorianCalendar. |
static ZonedDateTime |
getZonedDateTime(XMLGregorianCalendar aCal)
Get the passed
XMLGregorianCalendar as ZonedDateTime. |
@Nonnull public static DatatypeFactory getDatatypeFactory()
DatatypeFactory used internally in this class.public static int getTimezoneOffsetInMinutes(int nOffsetInMillis)
nOffsetInMillis - The offset in milliseconds to use. May not be null.public static int getTimezoneOffsetInMinutes(@Nonnull Calendar aCalendar)
XMLGregorianCalendar.aCalendar - The calendar to use. May not be null.@Nonnull public static GregorianCalendar getCalendar(@Nonnull Date aDate)
GregorianCalendar using the default time
zone.aDate - The source date. May be null.null.@Nonnull public static GregorianCalendar getCalendarDefaultTimeZone(long nMillis)
GregorianCalendar.nMillis - Milliseconds since 1.1.1970null.@Nonnull public static GregorianCalendar getCalendarUTC(long nMillis)
GregorianCalendar.nMillis - Milliseconds since 1.1.1970null.@Nonnull public static XMLGregorianCalendar createNewCalendar()
null.@Nonnull public static XMLGregorianCalendar getXMLCalendarDateNow()
XMLGregorianCalendar.null.@Nullable public static XMLGregorianCalendar getXMLCalendarDate(@Nullable LocalDate aBase)
XMLGregorianCalendar date (without a
time).aBase - The source object. May be null.null if the parameter is null.@Nullable public static XMLGregorianCalendar getXMLCalendarDate(@Nullable LocalDate aBase, int nTimezoneOffsetInMinutes)
XMLGregorianCalendar date (without a
time).aBase - The source object. May be null.nTimezoneOffsetInMinutes - Timezone offset in minutes. Use
DatatypeConstants.FIELD_UNDEFINED if none is to be used.null if the parameter is null.@Nullable public static XMLGregorianCalendar getXMLCalendarDate(@Nullable Date aBase)
XMLGregorianCalendar date (without a
time).aBase - The source object. May be null.null if the parameter is null.@Nullable public static XMLGregorianCalendar getXMLCalendarDate(@Nullable GregorianCalendar aBase)
XMLGregorianCalendar date (without a
time).aBase - The source object. May be null.null if the parameter is null.@Nullable public static XMLGregorianCalendar getXMLCalendarDate(@Nullable XMLGregorianCalendar aBase)
XMLGregorianCalendar date (without a
time).aBase - The source object. May be null.null if the parameter is null.@Nonnull public static XMLGregorianCalendar getXMLCalendarDate(int nYear, int nMonth, int nDay)
Create a Java representation of XML Schema builtin datatype
date or g*.
For example, an instance of gYear can be created invoking this
factory with month and day parameters set to
DatatypeConstants.FIELD_UNDEFINED.
A DatatypeConstants.FIELD_UNDEFINED value indicates that field is
not set.
nYear - Year to be created.nMonth - Month to be created.nDay - Day to be created.XMLGregorianCalendar created from parameter values.IllegalArgumentException - If any individual parameter's value is outside the maximum value
constraint for the field as determined by the Date/Time Data
Mapping table in XMLGregorianCalendar or if the composite
values constitute an invalid XMLGregorianCalendar
instance as determined by XMLGregorianCalendar.isValid().DatatypeConstants.FIELD_UNDEFINED@Nonnull public static XMLGregorianCalendar getXMLCalendarDate(int nYear, int nMonth, int nDay, int nTimezone)
Create a Java representation of XML Schema builtin datatype
date or g*.
For example, an instance of gYear can be created invoking this
factory with month and day parameters set to
DatatypeConstants.FIELD_UNDEFINED.
A DatatypeConstants.FIELD_UNDEFINED value indicates that field is
not set.
nYear - Year to be created.nMonth - Month to be created.nDay - Day to be created.nTimezone - Offset in minutes. DatatypeConstants.FIELD_UNDEFINED
indicates optional field is not set.XMLGregorianCalendar created from parameter values.IllegalArgumentException - If any individual parameter's value is outside the maximum value
constraint for the field as determined by the Date/Time Data
Mapping table in XMLGregorianCalendar or if the composite
values constitute an invalid XMLGregorianCalendar
instance as determined by XMLGregorianCalendar.isValid().DatatypeConstants.FIELD_UNDEFINED@Nonnull public static XMLGregorianCalendar getXMLCalendarTimeNow()
XMLGregorianCalendar.null.@Nullable public static XMLGregorianCalendar getXMLCalendarTime(@Nullable LocalTime aBase)
XMLGregorianCalendar time (without a
date).aBase - The source object. May be null.null if the parameter is null.@Nullable public static XMLGregorianCalendar getXMLCalendarTime(@Nullable Date aBase)
XMLGregorianCalendar time (without a
date).aBase - The source object. May be null.null if the parameter is null.@Nullable public static XMLGregorianCalendar getXMLCalendarTime(@Nullable GregorianCalendar aBase)
XMLGregorianCalendar time (without a
date).aBase - The source object. May be null.null if the parameter is null.@Nullable public static XMLGregorianCalendar getXMLCalendarTime(@Nullable XMLGregorianCalendar aBase)
XMLGregorianCalendar time (without a
date).aBase - The source object. May be null.null if the parameter is null.@Nonnull public static XMLGregorianCalendar getXMLCalendarTime(int nHour, int nMinute, int nSecond, int nMilliSecond)
Create a Java representation of XML Schema builtin datatype
date or g*.
For example, an instance of gYear can be created invoking this
factory with month and day parameters set to
DatatypeConstants.FIELD_UNDEFINED.
A DatatypeConstants.FIELD_UNDEFINED value indicates that field is
not set.
nHour - Hour to be created.nMinute - Minute to be created.nSecond - Second to be created.nMilliSecond - Milli second to be created.XMLGregorianCalendar created from parameter values.IllegalArgumentException - If any individual parameter's value is outside the maximum value
constraint for the field as determined by the Date/Time Data
Mapping table in XMLGregorianCalendar or if the composite
values constitute an invalid XMLGregorianCalendar
instance as determined by XMLGregorianCalendar.isValid().DatatypeConstants.FIELD_UNDEFINED@Nonnull public static XMLGregorianCalendar getXMLCalendarTime(int nHour, int nMinute, int nSecond, int nMilliSecond, int nTimezone)
Create a Java representation of XML Schema builtin datatype
date or g*.
For example, an instance of gYear can be created invoking this
factory with month and day parameters set to
DatatypeConstants.FIELD_UNDEFINED.
A DatatypeConstants.FIELD_UNDEFINED value indicates that field is
not set.
nHour - Hour to be created.nMinute - Minute to be created.nSecond - Second to be created.nMilliSecond - Milli second to be created.nTimezone - Offset in minutes. DatatypeConstants.FIELD_UNDEFINED
indicates optional field is not set.XMLGregorianCalendar created from parameter values.IllegalArgumentException - If any individual parameter's value is outside the maximum value
constraint for the field as determined by the Date/Time Data
Mapping table in XMLGregorianCalendar or if the composite
values constitute an invalid XMLGregorianCalendar
instance as determined by XMLGregorianCalendar.isValid().DatatypeConstants.FIELD_UNDEFINED@Nonnull public static XMLGregorianCalendar getXMLCalendarNow()
XMLGregorianCalendar in the
default time zone.null.@Nonnull public static XMLGregorianCalendar getXMLCalendarNowUTC()
XMLGregorianCalendar in UTC.null.@Nullable public static XMLGregorianCalendar getXMLCalendar(@Nullable LocalDateTime aBase)
XMLGregorianCalendar with date and time.aBase - The source object. May be null.null if the parameter is null.@Nullable public static XMLGregorianCalendar getXMLCalendar(@Nullable ZonedDateTime aBase)
XMLGregorianCalendar with date and time.aBase - The source object. May be null.null if the parameter is null.@Nullable public static XMLGregorianCalendar getXMLCalendar(@Nullable GregorianCalendar aCal)
GregorianCalendar as XMLGregorianCalendar.aCal - Source calendar. May be null.null if the passed calendar is null.@Nullable public static XMLGregorianCalendar getXMLCalendar(@Nullable XMLGregorianCalendar aDate, @Nullable XMLGregorianCalendar aTime)
XMLGregorianCalendar using separate objects for date
and time.aDate - Source date. May be null.aTime - Source time. May be null.null if the passed date and time are null
.@Nonnull public static XMLGregorianCalendar getXMLCalendar(long nMillis)
XMLGregorianCalendar.nMillis - Milliseconds since 1.1.1970null.@Nonnull public static XMLGregorianCalendar getXMLCalendarUTC(long nMillis)
XMLGregorianCalendar.nMillis - Milliseconds since 1.1.1970null.@Nullable public static XMLGregorianCalendar getXMLCalendar(@Nullable Date aDate)
Date as XMLGregorianCalendar.aDate - Source date. May be null.null if the passed date is null.@Nullable public static GregorianCalendar getGregorianCalendar(@Nullable XMLGregorianCalendar aCal)
XMLGregorianCalendar to a
GregorianCalendar.aCal - Source calendar. May be null.null if the parameter is null.@Nullable public static LocalDate getLocalDate(@Nullable XMLGregorianCalendar aCal)
XMLGregorianCalendar as LocalDate.aCal - The source XMLGregorianCalendar. May be null.null if the parameter is null.@Nullable public static LocalTime getLocalTime(@Nullable XMLGregorianCalendar aCal)
XMLGregorianCalendar as LocalTime.aCal - The source XMLGregorianCalendar. May be null.null if the parameter is null.@Nullable public static LocalDateTime getLocalDateTime(@Nullable XMLGregorianCalendar aCal)
XMLGregorianCalendar as LocalDateTime.aCal - The source XMLGregorianCalendar. May be null.null if the parameter is null.@Nullable public static ZonedDateTime getZonedDateTime(@Nullable XMLGregorianCalendar aCal)
XMLGregorianCalendar as ZonedDateTime.aCal - The source XMLGregorianCalendar. May be null.null if the parameter is null.@Nullable public static Date getDate(@Nullable XMLGregorianCalendar aCal)
XMLGregorianCalendar as Date.aCal - The source XMLGregorianCalendar. May be null.null if the parameter is null.@CheckForSigned public static long getMillis(@Nullable XMLGregorianCalendar aCal)
XMLGregorianCalendar as milliseconds.aCal - The source XMLGregorianCalendar. May be null.CGlobal.ILLEGAL_ULONG if the parameter is
null.Copyright © 2014–2022 Philip Helger. All rights reserved.