--- old/src/java.xml/share/classes/javax/xml/datatype/XMLGregorianCalendar.java 2015-04-21 18:33:55.508094845 +0400
+++ new/src/java.xml/share/classes/javax/xml/datatype/XMLGregorianCalendar.java 2015-04-21 18:33:55.416094845 +0400
@@ -43,17 +43,17 @@
* {@link DatatypeConstants#GMONTH}, and
* {@link DatatypeConstants#GDAY}
* defined in the XML Namespace
- * "http://www.w3.org/2001/XMLSchema"
.
+ * {@code "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.
+ * ISO 8601 Date and Time Formats. * - * + * *XML Schema 1.0 - * datatype + * | XML Schema 1.0 + * datatype * field |
- * Related XMLGregorianCalendar Accessor(s) |
+ * Related XMLGregorianCalendar Accessor(s) |
* Value Range | *|
---|---|---|---|---|---|
year | - * {@link #getYear()} + {@link #getEon()} or + * | year | + * {@link #getYear()} + {@link #getEon()} or * {@link #getEonAndYear} * |
- * getYear() is a value between -(10^9-1) to (10^9)-1
- * or {@link DatatypeConstants#FIELD_UNDEFINED}.- * {@link #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.
+ * | {@code getYear()} is a value between -(10^9-1) to (10^9)-1
+ * or {@link DatatypeConstants#FIELD_UNDEFINED}. + * {@link #getEon()} is high order year value in billion of years. + * {@code 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, @@ -89,20 +89,20 @@ * |
*
month | + *month | *{@link #getMonth()} | *1 to 12 or {@link DatatypeConstants#FIELD_UNDEFINED} | *||
day | + *day | *{@link #getDay()} | - * Independent of month, max range is 1 to 31 or {@link DatatypeConstants#FIELD_UNDEFINED}. + * | Independent of month, max range is 1 to 31 or {@link 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 | + *hour | *{@link #getHour()} | ** 0 to 23 or {@link DatatypeConstants#FIELD_UNDEFINED}. @@ -114,28 +114,28 @@ * | *||
minute | + *minute | *{@link #getMinute()} | *0 to 59 or {@link DatatypeConstants#FIELD_UNDEFINED} | *||
second | + *second | *
- * {@link #getSecond()} + {@link #getMillisecond()}/1000 or + * {@link #getSecond()} + {@link #getMillisecond()}/1000 or * {@link #getSecond()} + {@link #getFractionalSecond()} * |
*
- * {@link #getSecond()} from 0 to 60 or {@link DatatypeConstants#FIELD_UNDEFINED}. - * (Note: 60 only allowable for leap second.) + * {@link #getSecond()} from 0 to 60 or {@link DatatypeConstants#FIELD_UNDEFINED}. + * (Note: 60 only allowable for leap second.) * {@link #getFractionalSecond()} allows for infinite precision over the range from 0.0 to 1.0 when - * the {@link #getSecond()} is defined. - * FractionalSecond is optional and has a value of null when it is undefined.+ * the {@link #getSecond()} is defined. + * {@code FractionalSecond} is optional and has a value of {@code null} when it is undefined. * {@link #getMillisecond()} is the convenience * millisecond precision of value of {@link #getFractionalSecond()}. * |
* ||
timezone | + *timezone | *{@link #getTimezone()} | *Number of minutes or {@link DatatypeConstants#FIELD_UNDEFINED}. * Value range from -14 hours (-14 * 60 minutes) to 14 hours (14 * 60 minutes). @@ -145,14 +145,13 @@ * |
All maximum value space constraints listed for the fields in the table
- * above are checked by factory methods, @{link DatatypeFactory},
+ * above are checked by factory methods, {@link DatatypeFactory},
* setter methods and parse methods of
- * this class. IllegalArgumentException
is thrown when a
+ * this class. {@code 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: *
Note: Always use the {@link DatatypeFactory} to
- * construct an instance of XMLGregorianCalendar
.
+ * construct an instance of {@code XMLGregorianCalendar}.
* The constructor on this class cannot be guaranteed to
* produce an object with a consistent state and may be
- * removed in the future.
Unset all fields to undefined.
+ * Unset all fields to undefined. * *Set all int fields to {@link DatatypeConstants#FIELD_UNDEFINED} and reference fields - * to null.
+ * to null. */ public abstract void clear(); /** - *Reset this XMLGregorianCalendar
to its original values.
XMLGregorianCalendar
is reset to the same values as when it was created with
+ *
{@code XMLGregorianCalendar} is reset to the same values as when it was created with * {@link DatatypeFactory#newXMLGregorianCalendar()}, * {@link DatatypeFactory#newXMLGregorianCalendar(String lexicalRepresentation)}, * {@link DatatypeFactory#newXMLGregorianCalendar( @@ -250,83 +248,82 @@ * int seconds, * int milliseconds, * int timezone)}. - *
* - *reset()
is designed to allow the reuse of existing XMLGregorianCalendar
s
- * thus saving resources associated with the creation of new XMLGregorianCalendar
s.
{@code reset()} is designed to allow the reuse of existing {@code XMLGregorianCalendar}s + * thus saving resources associated with the creation of new {@code XMLGregorianCalendar}s. */ public abstract void reset(); /** - *
Set low and high order component of XSD dateTime
year field.
Unset this field by invoking the setter with a parameter value of null
.
Unset this field by invoking the setter with a parameter value of {@code null}.
*
* @param year value constraints summarized in year field of date/time field mapping table.
*
- * @throws IllegalArgumentException if year
parameter is
+ * @throws IllegalArgumentException if {@code year} parameter is
* outside value constraints for the field as specified in
* date/time field mapping table.
*/
public abstract void setYear(BigInteger year);
/**
- *
Set year of XSD dateTime
year field.
Unset this field by invoking the setter with a parameter value of - * {@link DatatypeConstants#FIELD_UNDEFINED}.
+ * {@link DatatypeConstants#FIELD_UNDEFINED}. * - *Note: if the absolute value of the year
parameter
+ *
Note: if the absolute value of the {@code year} parameter
* is less than 10^9, the eon component of the XSD year field is set to
- * null
by this method.
null
.
+ * If year is {@link DatatypeConstants#FIELD_UNDEFINED}, then eon is set to {@code null}.
*/
public abstract void setYear(int year);
/**
- * Set month.
+ * Set month. * - *Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
+ *Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
*
* @param month value constraints summarized in month field of date/time field mapping table.
*
- * @throws IllegalArgumentException if month
parameter is
+ * @throws IllegalArgumentException if {@code month} parameter is
* outside value constraints for the field as specified in
* date/time field mapping table.
*/
public abstract void setMonth(int month);
/**
- *
Set days in month.
+ * Set days in month. * - *Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
+ *Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
*
* @param day value constraints summarized in day field of date/time field mapping table.
*
- * @throws IllegalArgumentException if day
parameter is
+ * @throws IllegalArgumentException if {@code day} parameter is
* outside value constraints for the field as specified in
* date/time field mapping table.
*/
public abstract void setDay(int day);
/**
- *
Set the number of minutes in the timezone offset.
+ * Set the number of minutes in the timezone offset. * - *Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
+ *Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
*
* @param offset value constraints summarized in
* timezone field of date/time field mapping table.
*
- * @throws IllegalArgumentException if offset
parameter is
+ * @throws IllegalArgumentException if {@code offset} parameter is
* outside value constraints for the field as specified in
* date/time field mapping table.
*/
public abstract void setTimezone(int offset);
/**
- *
Set time as one unit.
+ * Set time as one unit. * * @param hour value constraints are summarized in * hour field of date/time field mapping table. @@ -352,71 +349,71 @@ } /** - *Set hours.
+ * Set hours. * - *Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
+ *Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
*
* @param hour value constraints summarized in hour field of date/time field mapping table.
*
- * @throws IllegalArgumentException if hour
parameter is outside value constraints for the field as specified in
+ * @throws IllegalArgumentException if {@code hour} parameter is outside value constraints for the field as specified in
* date/time field mapping table.
*/
public abstract void setHour(int hour);
/**
- *
Set minutes.
+ * Set minutes. * - *Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
+ *Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
*
* @param minute value constraints summarized in minute field of date/time field mapping table.
*
- * @throws IllegalArgumentException if minute
parameter is outside value constraints for the field as specified in
+ * @throws IllegalArgumentException if {@code minute} parameter is outside value constraints for the field as specified in
* date/time field mapping table.
*/
public abstract void setMinute(int minute);
/**
- *
Set seconds.
+ * Set seconds. * - *Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
+ *Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
*
* @param second value constraints summarized in second field of date/time field mapping table.
*
- * @throws IllegalArgumentException if second
parameter is outside value constraints for the field as specified in
+ * @throws IllegalArgumentException if {@code second} parameter is outside value constraints for the field as specified in
* date/time field mapping table.
*/
public abstract void setSecond(int second);
/**
- *
Set milliseconds.
+ * Set milliseconds. * - *Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
+ *Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
*
* @param millisecond value constraints summarized in
* second field of date/time field mapping table.
*
- * @throws IllegalArgumentException if millisecond
parameter is outside value constraints for the field as specified
+ * @throws IllegalArgumentException if {@code millisecond} parameter is outside value constraints for the field as specified
* in date/time field mapping table.
*/
public abstract void setMillisecond(int millisecond);
/**
- *
Set fractional seconds.
+ * Set fractional seconds. * - *Unset this field by invoking the setter with a parameter value of null
.
Unset this field by invoking the setter with a parameter value of {@code null}.
*
* @param fractional value constraints summarized in
* second field of date/time field mapping table.
*
- * @throws IllegalArgumentException if fractional
parameter is outside value constraints for the field as specified
+ * @throws IllegalArgumentException if {@code fractional} parameter is outside value constraints for the field as specified
* in date/time field mapping table.
*/
public abstract void setFractionalSecond(BigDecimal fractional);
/**
- *
Set time as one unit, including the optional infinite precision - * fractional seconds.
+ * Set time as one unit, including the optional infinite precision + * fractional seconds. * * @param hour value constraints are summarized in * hour field of date/time field mapping table. @@ -424,7 +421,7 @@ * minute field of date/time field mapping table. * @param second value constraints are summarized in * second field of date/time field mapping table. - * @param fractional value ofnull
indicates this optional
+ * @param fractional value of {@code null} indicates this optional
* field is not set.
*
* @throws IllegalArgumentException if any parameter is
@@ -445,7 +442,7 @@
/**
- * Set time as one unit, including optional milliseconds.
+ * Set time as one unit, including optional milliseconds. * * @param hour value constraints are summarized in * hour field of date/time field mapping table. @@ -469,13 +466,13 @@ } /** - *Return high order component for XML Schema 1.0 dateTime datatype field for
- * year
.
- * null
if this optional part of the year field is not defined.
Value constraints for this value are summarized in - * year field of date/time field mapping table.
- * @return eon of thisXMLGregorianCalendar
. The value
+ * year field of date/time field mapping table.
+ * @return eon of this {@code XMLGregorianCalendar}. The value
* returned is an integer multiple of 10^9.
*
* @see #getYear()
@@ -484,13 +481,13 @@
public abstract BigInteger getEon();
/**
- * Return low order component for XML Schema 1.0 dateTime datatype field for
- * year
or {@link DatatypeConstants#FIELD_UNDEFINED}.
Value constraints for this value are summarized in - * year field of date/time field mapping table.
+ * year field of date/time field mapping table. * - * @return year of thisXMLGregorianCalendar
.
+ * @return year of this {@code XMLGregorianCalendar}.
*
* @see #getEon()
* @see #getEonAndYear()
@@ -498,16 +495,16 @@
public abstract int getYear();
/**
- * Return XML Schema 1.0 dateTime datatype field for
- * year
.
Value constraints for this value are summarized in - * year field of date/time field mapping table.
+ * year field of date/time field mapping table. * - * @return sum ofeon
and BigInteger.valueOf(year)
- * when both fields are defined. When only year
is defined,
- * return it. When both eon
and year
are not
- * defined, return null
.
+ * @return sum of {@code eon} and {@code BigInteger.valueOf(year)}
+ * when both fields are defined. When only {@code year} is defined,
+ * return it. When both {@code eon} and {@code year} are not
+ * defined, return {@code null}.
*
* @see #getEon()
* @see #getYear()
@@ -515,21 +512,21 @@
public abstract BigInteger getEonAndYear();
/**
- * Return number of month or {@link DatatypeConstants#FIELD_UNDEFINED}.
+ * Return number of month or {@link DatatypeConstants#FIELD_UNDEFINED}. * *Value constraints for this value are summarized in - * month field of date/time field mapping table.
+ * month field of date/time field mapping table. * - * @return year of thisXMLGregorianCalendar
.
+ * @return year of this {@code XMLGregorianCalendar}.
*
*/
public abstract int getMonth();
/**
- * Return day in month or {@link DatatypeConstants#FIELD_UNDEFINED}.
+ * Return day in month or {@link DatatypeConstants#FIELD_UNDEFINED}.
*
* Value constraints for this value are summarized in - * day field of date/time field mapping table.
+ * day field of date/time field mapping table. * * @see #setDay(int) */ @@ -540,7 +537,7 @@ * {@link DatatypeConstants#FIELD_UNDEFINED} if this optional field is not defined. * *Value constraints for this value are summarized in - * timezone field of date/time field mapping table.
+ * timezone field of date/time field mapping table. * * @see #setTimezone(int) */ @@ -551,34 +548,34 @@ * Returns {@link DatatypeConstants#FIELD_UNDEFINED} if this field is not defined. * *Value constraints for this value are summarized in - * hour field of date/time field mapping table.
+ * hour field of date/time field mapping table. * @see #setTime(int, int, int) */ public abstract int getHour(); /** - * Return minutes or {@link DatatypeConstants#FIELD_UNDEFINED}. + * Return minutes or {@link DatatypeConstants#FIELD_UNDEFINED}. * Returns {@link DatatypeConstants#FIELD_UNDEFINED} if this field is not defined. * *Value constraints for this value are summarized in - * minute field of date/time field mapping table.
+ * minute field of date/time field mapping table. * @see #setTime(int, int, int) */ public abstract int getMinute(); /** - *Return seconds or {@link DatatypeConstants#FIELD_UNDEFINED}.
+ * Return seconds or {@link DatatypeConstants#FIELD_UNDEFINED}. * *Returns {@link DatatypeConstants#FIELD_UNDEFINED} if this field is not defined. * When this field is not defined, the optional xs:dateTime * fractional seconds field, represented by * {@link #getFractionalSecond()} and {@link #getMillisecond()}, - * must not be defined.
+ * must not be defined. * *Value constraints for this value are summarized in - * second field of date/time field mapping table.
+ * second field of date/time field mapping table. * - * @return Second of thisXMLGregorianCalendar
.
+ * @return Second of this {@code XMLGregorianCalendar}.
*
* @see #getFractionalSecond()
* @see #getMillisecond()
@@ -587,20 +584,20 @@
public abstract int getSecond();
/**
- * Return millisecond precision of {@link #getFractionalSecond()}.
+ * Return millisecond precision of {@link #getFractionalSecond()}. * *This method represents a convenience accessor to infinite
* precision fractional second value returned by
* {@link #getFractionalSecond()}. The returned value is the rounded
* down to milliseconds value of
* {@link #getFractionalSecond()}. When {@link #getFractionalSecond()}
- * returns null
, this method must return
- * {@link DatatypeConstants#FIELD_UNDEFINED}.
Value constraints for this value are summarized in - * second field of date/time field mapping table.
+ * second field of date/time field mapping table. * - * @return Millisecond of thisXMLGregorianCalendar
.
+ * @return Millisecond of this {@code XMLGregorianCalendar}.
*
* @see #getFractionalSecond()
* @see #setTime(int, int, int)
@@ -618,18 +615,18 @@
}
/**
- * Return fractional seconds.
+ * Return fractional seconds. * - *null
is returned when this optional field is not defined.
{@code null} is returned when this optional field is not defined. * *
Value constraints are detailed in - * second field of date/time field mapping table.
+ * 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 {@link #getSecond()}, - * does not return {@link DatatypeConstants#FIELD_UNDEFINED}.
+ * does not return {@link DatatypeConstants#FIELD_UNDEFINED}. * - * @return fractional seconds of thisXMLGregorianCalendar
.
+ * @return fractional seconds of this {@code XMLGregorianCalendar}.
*
* @see #getSecond()
* @see #setTime(int, int, int, BigDecimal)
@@ -638,51 +635,51 @@
// comparisons
/**
- * Compare two instances of W3C XML Schema 1.0 date/time datatypes + * 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.
+ * Order relation on dateTime. * - *xsd:dateTime
datatype field mapping to accessors of
+ *
{@code xsd:dateTime} datatype field mapping to accessors of * this class are defined in - * date/time field mapping table.
+ * date/time field mapping table. * - * @param xmlGregorianCalendar Instance ofXMLGregorianCalendar
to compare
+ * @param xmlGregorianCalendar Instance of {@code XMLGregorianCalendar} to compare
*
- * @return The relationship between this
XMLGregorianCalendar
and
- * the specified xmlGregorianCalendar
as
+ * @return The relationship between {@code this} {@code XMLGregorianCalendar} and
+ * the specified {@code xmlGregorianCalendar} as
* {@link DatatypeConstants#LESSER},
* {@link DatatypeConstants#EQUAL},
* {@link DatatypeConstants#GREATER} or
* {@link DatatypeConstants#INDETERMINATE}.
*
- * @throws NullPointerException if xmlGregorianCalendar
is null.
+ * @throws NullPointerException if {@code xmlGregorianCalendar} is null.
*/
public abstract int compare(XMLGregorianCalendar xmlGregorianCalendar);
/**
- * Normalize this instance to UTC.
+ * 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).
+ *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).
*
- * @return this
XMLGregorianCalendar
normalized to UTC.
+ * @return {@code this} {@code XMLGregorianCalendar} normalized to UTC.
*/
public abstract XMLGregorianCalendar normalize();
/**
- *
Compares this calendar to the specified object. The result is
- * true
if and only if the argument is not null and is an
- * XMLGregorianCalendar
object that represents the same
- * instant in time as this object.
true
when obj
is an instance of
- * XMLGregorianCalendar
and
+ * @return {@code true} when {@code obj} is an instance of
+ * {@code XMLGregorianCalendar} and
* {@link #compare(XMLGregorianCalendar obj)}
* returns {@link DatatypeConstants#EQUAL},
- * otherwise false
.
+ * otherwise {@code false}.
*/
public boolean equals(Object obj) {
@@ -693,7 +690,7 @@
}
/**
- * Returns a hash code consistent with the definition of the equals method.
+ * Returns a hash code consistent with the definition of the equals method. * * @return hash code of this object. */ @@ -721,15 +718,15 @@ } /** - *Return the lexical representation of this
instance.
+ * Return the lexical representation of {@code this} instance.
* The format is specified in
* XML Schema 1.0 Part 2, Section 3.2.[7-14].1,
- * Lexical Representation".
Specific target lexical representation format is determined by - * {@link #getXMLSchemaType()}.
+ * {@link #getXMLSchemaType()}. * - * @return XML, asString
, representation of this XMLGregorianCalendar
+ * @return XML, as {@code String}, representation of this {@code XMLGregorianCalendar}
*
* @throws IllegalStateException if the combination of set fields
* does not match one of the eight defined XML Schema builtin date/time datatypes.
@@ -737,14 +734,14 @@
public abstract String toXMLFormat();
/**
- * 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 the name of the XML Schema date/time type that this instance + * maps to. Type is computed based on fields that are set. * *
- * Required fields for XML Schema 1.0 Date/Time Datatypes. + * Required fields for XML Schema 1.0 Date/Time Datatypes. * (timezone is optional for all date/time datatypes) * |
*
---|
* Field by Field Conversion from this class to
- * java.util.GregorianCalendar
+ * {@code java.util.GregorianCalendar}
* |
* |||
---|---|---|---|
java.util.GregorianCalendar field |
- * javax.xml.datatype.XMLGregorianCalendar field |
+ * {@code java.util.GregorianCalendar} field | + *{@code javax.xml.datatype.XMLGregorianCalendar} field | *
ERA |
- * {@link #getEonAndYear()}.signum() < 0 ? GregorianCalendar.BC : GregorianCalendar.AD |
+ * {@code ERA} | + *{@link #getEonAndYear()}{@code .signum() < 0 ? GregorianCalendar.BC : GregorianCalendar.AD} | *
YEAR |
- * {@link #getEonAndYear()}.abs().intValue() * |
+ * {@code YEAR} | + *{@link #getEonAndYear()}{@code .abs().intValue()}* | *
MONTH |
+ * {@code MONTH} | *{@link #getMonth()} - {@link DatatypeConstants#JANUARY} + {@link GregorianCalendar#JANUARY} | *|
DAY_OF_MONTH |
+ * {@code DAY_OF_MONTH} | *{@link #getDay()} | *|
HOUR_OF_DAY |
+ * {@code HOUR_OF_DAY} | *{@link #getHour()} | *|
MINUTE |
+ * {@code MINUTE} | *{@link #getMinute()} | *|
SECOND |
+ * {@code SECOND} | *{@link #getSecond()} | *|
MILLISECOND |
+ * {@code MILLISECOND} | *get millisecond order from {@link #getFractionalSecond()}* | *|
GregorianCalendar.setTimeZone(TimeZone) |
+ * {@code GregorianCalendar.setTimeZone(TimeZone)} | *{@link #getTimezone()} formatted into Custom timezone id | *