java.lang.Objectjavax.xml.datatype.XMLGregorianCalendar
All Implemented Interfaces:
Cloneable
Representation for W3C XML Schema 1.0 date/time datatypes.
Specifically, these date/time datatypes are
dateTime
,
time
,
date
,
gYearMonth
,
gMonthDay
,
gYear
gMonth
and
gDay
defined in the XML Namespace
"http://www.w3.org/2001/XMLSchema"
.
These datatypes are normatively defined in
W3C XML Schema 1.0 Part 2, Section 3.2.7-14.
The table below defines the mapping between XML Schema 1.0 date/time datatype fields and this class' fields. It also summarizes the value constraints for the date and time fields defined in W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats.
Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation | ||
---|---|---|
XML Schema 1.0 datatype field |
Related XMLGregorianCalendar Accessor(s) |
Value Range |
year | #getYear() + #getEon() or #getEonAndYear |
getYear() is a value between -(10^9-1) to (10^9)-1
or DatatypeConstants#FIELD_UNDEFINED .#getEon() is high order year value in billion of years. getEon() has values greater than or equal to (10^9) or less than or equal to -(10^9).
A value of null indicates field is undefined.
Given that XML Schema 1.0 errata states that the year zero
will be a valid lexical value in a future version of XML Schema,
this class allows the year field to be set to zero. Otherwise,
the year field value is handled exactly as described
in the errata and [ISO-8601-1988]. Note that W3C XML Schema 1.0
validation does not allow for the year field to have a value of zero.
|
month | #getMonth() | 1 to 12 or DatatypeConstants#FIELD_UNDEFINED |
day | #getDay() | Independent of month, max range is 1 to 31 or DatatypeConstants#FIELD_UNDEFINED . The normative value constraint stated relative to month field's value is in W3C XML Schema 1.0 Part 2, Appendix D. |
hour | #getHour() | 0 to 24 or DatatypeConstants#FIELD_UNDEFINED . For a value of 24, the minute and second field must be zero per XML Schema Errata. |
minute | #getMinute() | 0 to 59 or DatatypeConstants#FIELD_UNDEFINED |
second |
#getSecond() + #getMillisecond() /1000 or #getSecond() + #getFractionalSecond() |
#getSecond() from 0 to 60 or DatatypeConstants#FIELD_UNDEFINED . (Note: 60 only allowable for leap second.) #getFractionalSecond() allows for infinite precision over the range from 0.0 to 1.0 when the #getSecond() is defined. FractionalSecond is optional and has a value of null when it is undefined.#getMillisecond() is the convenience millisecond precision of value of #getFractionalSecond() . |
timezone | #getTimezone() | Number of minutes or DatatypeConstants#FIELD_UNDEFINED . Value range from -14 hours (-14 * 60 minutes) to 14 hours (14 * 60 minutes). |
All maximum value space constraints listed for the fields in the table
above are checked by factory methods, @{link DatatypeFactory},
setter methods and parse methods of
this class. IllegalArgumentException
is thrown when a
parameter's value is outside the value constraint for the field or
if the composite
values constitute an invalid XMLGregorianCalendar instance (for example, if
the 31st of June is specified).
The following operations are defined for this class:
- href="mailto:Joseph.Fialli@Sun.com">Joseph Fialli
- href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi
- href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor
$
- Revision: 759822 $, $Date: 2009-03-29 21:15:11 -0400 (Sun, 29 Mar 2009) $1.5
- Method from javax.xml.datatype.XMLGregorianCalendar Summary: |
---|
add, clear, clone, compare, equals, getDay, getEon, getEonAndYear, getFractionalSecond, getHour, getMillisecond, getMinute, getMonth, getSecond, getTimeZone, getTimezone, getXMLSchemaType, getYear, hashCode, isValid, normalize, reset, setDay, setFractionalSecond, setHour, setMillisecond, setMinute, setMonth, setSecond, setTime, setTime, setTime, setTimezone, setYear, setYear, toGregorianCalendar, toGregorianCalendar, toString, toXMLFormat |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from javax.xml.datatype.XMLGregorianCalendar Detail: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Add The computation is specified in
XML Schema 1.0 Part 2, Appendix E,
Adding durations to dateTimes>.
date/time field mapping table
defines the mapping from XML Schema 1.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Unset all fields to undefined. Set all int fields to DatatypeConstants#FIELD_UNDEFINED and reference fields to null. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Creates and returns a copy of this object. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Compare two instances of W3C XML Schema 1.0 date/time datatypes according to partial order relation defined in W3C XML Schema 1.0 Part 2, Section 3.2.7.3, Order relation on dateTime.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Indicates whether parameter | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Value constraints for this value are summarized in day field of date/time field mapping table. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return high order component for XML Schema 1.0 dateTime datatype field for
Value constraints for this value are summarized in year field of date/time field mapping table. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return XML Schema 1.0 dateTime datatype field for
Value constraints for this value are summarized in year field of date/time field mapping table. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return fractional seconds.
Value constraints are detailed in second field of date/time field mapping table. This optional field can only have a defined value when the xs:dateTime second field, represented by #getSecond() , does not return DatatypeConstants#FIELD_UNDEFINED . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Value constraints for this value are summarized in hour field of date/time field mapping table. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return millisecond precision of #getFractionalSecond() . This method represents a convenience accessor to infinite
precision fractional second value returned by
#getFractionalSecond() . The returned value is the rounded
down to milliseconds value of
#getFractionalSecond() . When #getFractionalSecond()
returns Value constraints for this value are summarized in second field of date/time field mapping table. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Value constraints for this value are summarized in minute field of date/time field mapping table. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return number of month or DatatypeConstants#FIELD_UNDEFINED . Value constraints for this value are summarized in month field of date/time field mapping table. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return seconds or DatatypeConstants#FIELD_UNDEFINED . Returns DatatypeConstants#FIELD_UNDEFINED if this field is not defined. When this field is not defined, the optional xs:dateTime fractional seconds field, represented by #getFractionalSecond() and #getMillisecond() , must not be defined. Value constraints for this value are summarized in second field of date/time field mapping table. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a If timezone field is defined for this instance, returns TimeZone initialized with custom timezone id of zoneoffset. If timezone field is undefined, try the defaultZoneoffset that was passed in. If defaultZoneoffset is FIELD_UNDEFINED, return default timezone for this host. (Same default as java.util.GregorianCalendar). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Value constraints for this value are summarized in timezone field of date/time field mapping table. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return the name of the XML Schema date/time type that this instance maps to. Type is computed based on fields that are set.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return low order component for XML Schema 1.0 dateTime datatype field for
Value constraints for this value are summarized in year field of date/time field mapping table. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a hash code consistent with the definition of the equals method. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
getXMLSchemaType() constraints. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Normalize this instance to UTC. 2000-03-04T23:00:00+03:00 normalizes to 2000-03-04T20:00:00Z Implements W3C XML Schema Part 2, Section 3.2.7.3 (A). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reset this
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set days in month. Unset this field by invoking the setter with a parameter value of DatatypeConstants#FIELD_UNDEFINED . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set fractional seconds. Unset this field by invoking the setter with a parameter value of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set hours. Unset this field by invoking the setter with a parameter value of DatatypeConstants#FIELD_UNDEFINED . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set milliseconds. Unset this field by invoking the setter with a parameter value of DatatypeConstants#FIELD_UNDEFINED . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set minutes. Unset this field by invoking the setter with a parameter value of DatatypeConstants#FIELD_UNDEFINED . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set month. Unset this field by invoking the setter with a parameter value of DatatypeConstants#FIELD_UNDEFINED . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set seconds. Unset this field by invoking the setter with a parameter value of DatatypeConstants#FIELD_UNDEFINED . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set time as one unit. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set time as one unit, including the optional infinite precision fractional seconds. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set time as one unit, including optional milliseconds. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set the number of minutes in the timezone offset. Unset this field by invoking the setter with a parameter value of DatatypeConstants#FIELD_UNDEFINED . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set low and high order component of XSD Unset this field by invoking the setter with a parameter value of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set year of XSD Unset this field by invoking the setter with a parameter value of DatatypeConstants#FIELD_UNDEFINED . Note: if the absolute value of the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Convert this When
To ensure consistency in conversion implementations, the new
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Convert this Since XML Schema 1.0 date/time datetypes has no concept of
timezone ids or daylight savings timezone ids, this conversion operation
allows the user to explicitly specify one with
To compute the return value's To ensure consistency in conversion implementations, the new
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a The result is a lexical representation generated by #toXMLFormat() . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return the lexical representation of Specific target lexical representation format is determined by #getXMLSchemaType() . |