/*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the "License"). You may not use this file except
* in compliance with the License.
*
* You can obtain a copy of the license at
* https://jaxp.dev.java.net/CDDLv1.0.html.
* See the License for the specific language governing
* permissions and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* HEADER in each file and include the License file at
* https://jaxp.dev.java.net/CDDLv1.0.html
* If applicable add the following below this CDDL HEADER
* with the fields enclosed by brackets "[]" replaced with
* your own identifying information: Portions Copyright
* [year] [name of copyright owner]
*/
/*
* $Id: XMLGregorianCalendar.java,v 1.7 2006/01/12 18:53:55 ndw Exp $
* @(#)XMLGregorianCalendar.java 1.28 06/03/23
*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
*/
package javax.xml.datatype;
import javax.xml.namespace.QName;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.TimeZone;
import java.util.GregorianCalendar;
/**
* <p>Representation for W3C XML Schema 1.0 date/time datatypes.
* Specifically, these date/time datatypes are
* {@link DatatypeConstants#DATETIME},
* {@link DatatypeConstants#TIME},
* {@link DatatypeConstants#DATE},
* {@link DatatypeConstants#GYEARMONTH},
* {@link DatatypeConstants#GMONTHDAY},
* {@link DatatypeConstants#GYEAR},
* {@link DatatypeConstants#GMONTH}, and
* {@link DatatypeConstants#GDAY}
* defined in the XML Namespace
* <code>"http://www.w3.org/2001/XMLSchema"</code>.
* These datatypes are normatively defined in
* <a href="http://www.w3.org/TR/xmlschema-2/#dateTime">W3C XML Schema 1.0 Part 2, Section 3.2.7-14</a>.</p>
*
* <p>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
* <a href="http://www.w3.org/TR/xmlschema-2/#isoformats">W3C XML Schema 1.0 Part 2, Appendix D,
* <i>ISO 8601 Date and Time Formats</i></a>.</p>
*
* <a name="datetimefieldmapping"/>
* <table border="2" rules="all" cellpadding="2">
* <thead>
* <tr>
* <th align="center" colspan="3">
* Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation
* </th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <th>XML Schema 1.0<br/>
* datatype<br/>
* field</th>
* <th>Related<br/>XMLGregorianCalendar<br/>Accessor(s)</th>
* <th>Value Range</th>
* </tr>
* <tr>
* <td><a name="datetimefield-year"/>year</td>
* <td> {@link #getYear()} + {@link #getEon()} or<br/>
* {@link #getEonAndYear}
* </td>
* <td> <code>getYear()</code> is a value between -(10^9-1) to (10^9)-1
* or {@link DatatypeConstants#FIELD_UNDEFINED}.<br/>
* {@link #getEon()} is high order year value in billion of years.<br/>
* <code>getEon()</code> 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.</br>
* Given that <a href="http://www.w3.org/2001/05/xmlschema-errata#e2-63">XML Schema 1.0 errata</a> 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.
* </td>
* </tr>
* <tr>
* <td><a name="datetimefield-month"/>month</td>
* <td> {@link #getMonth()} </td>
* <td> 1 to 12 or {@link DatatypeConstants#FIELD_UNDEFINED} </td>
* </tr>
* <tr>
* <td><a name="datetimefield-day"/>day</td>
* <td> {@link #getDay()} </td>
=1= |