286N/A * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. 286N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 286N/A * This code is free software; you can redistribute it and/or modify it 286N/A * under the terms of the GNU General Public License version 2 only, as 286N/A * published by the Free Software Foundation. Oracle designates this 286N/A * particular file as subject to the "Classpath" exception as provided 286N/A * by Oracle in the LICENSE file that accompanied this code. 286N/A * This code is distributed in the hope that it will be useful, but WITHOUT 286N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 286N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 286N/A * version 2 for more details (a copy is included in the LICENSE file that 286N/A * accompanied this code). 286N/A * You should have received a copy of the GNU General Public License version 286N/A * 2 along with this work; if not, write to the Free Software Foundation, 286N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 286N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 286N/A * or visit www.oracle.com if you need additional information or have any 286N/A * <p>Factory that creates new <code>javax.xml.datatype</code> <code>Object</code>s that map XML to/from Java <code>Object</code>s.</p> 286N/A * <p><a name="DatatypeFactory.newInstance"/>{@link #newInstance()} is used to create a new <code>DatatypeFactory</code>. 286N/A * The following implementation resolution mechanisms are used in the following order:</p> 286N/A * If the system property specified by {@link #DATATYPEFACTORY_PROPERTY}, "<code>javax.xml.datatype.DatatypeFactory</code>", 286N/A * exists, a class with the name of the property's value is instantiated. 286N/A * Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}. 286N/A * The <code>Properties</code> <code>Object </code> is then queried for the property as documented in the prior step 286N/A * and processed as documented in the prior step. 286N/A * Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}. 286N/A * The final mechanism is to attempt to instantiate the <code>Class</code> specified by 286N/A * {@link #DATATYPEFACTORY_IMPLEMENTATION_CLASS}. 286N/A * Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}. 286N/A * @author <a href="mailto:Joseph.Fialli@Sun.COM">Joseph Fialli</a> 286N/A * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a> 286N/A * @author <a href="mailto:Neeraj.Bajaj@sun.com">Neeraj Bajaj</a> 286N/A * @version $Revision: 1.13 $, $Date: 2010/03/11 23:10:53 $ 286N/A * <p>Default property name as defined in JSR 206: Java(TM) API for XML Processing (JAXP) 1.3.</p> 286N/A * <p>Default value is <code>javax.xml.datatype.DatatypeFactory</code>.</p> 286N/A * <p>Default implementation class name as defined in 286N/A * <em>JSR 206: Java(TM) API for XML Processing (JAXP) 1.3</em>.</p> 286N/A * <p>Implementers should specify the name of an appropriate class 286N/A * to be instantiated if no other implementation resolution mechanism 286N/A * <p>Users should not refer to this field; it is intended only to 286N/A * document a factory implementation detail. 286N/A * to constrain the value space of dayTimeDuration ([^YM]*[DT].*) 286N/A * and yearMonthDuration ([^DT]*). Note that these expressions rely on 286N/A * the fact that the value must be an xs:Duration, they simply exclude 286N/A * <p>Protected constructor to prevent instaniation outside of package.</p> 286N/A * <p>Use {@link #newInstance()} to create a <code>DatatypeFactory</code>.</p> 286N/A * <p>Obtain a new instance of a <code>DatatypeFactory</code>.</p> 286N/A * <p>The implementation resolution mechanisms are <a href="#DatatypeFactory.newInstance">defined</a> in this 286N/A * <code>Class</code>'s documentation.</p> 286N/A * @return New instance of a <code>DatatypeFactory</code> 286N/A * @throws DatatypeConfigurationException If the implementation is not 286N/A * available or cannot be instantiated. 286N/A * @see #newInstance(String factoryClassName, ClassLoader classLoader) 286N/A /* The default property name according to the JAXP spec */ 286N/A /* The fallback implementation class name */ 286N/A * <p>Obtain a new instance of a <code>DatatypeFactory</code> from class name. 286N/A * This function is useful when there are multiple providers in the classpath. 286N/A * It gives more control to the application as it can specify which provider 286N/A * should be loaded.</p> 286N/A * <p>Once an application has obtained a reference to a <code>DatatypeFactory</code> 286N/A * it can use the factory to configure and obtain datatype instances.</P> 286N/A * <h2>Tip for Trouble-shooting</h2> 286N/A * <p>Setting the <code>jaxp.debug</code> system property will cause 286N/A * this method to print a lot of debug messages 286N/A * to <code>System.err</code> about what it is doing and where it is looking at.</p> 286N/A * <p> If you have problems try:</p> 286N/A * java -Djaxp.debug=1 YourProgram .... 286N/A * @param factoryClassName fully qualified factory class name that provides implementation of <code>javax.xml.datatype.DatatypeFactory</code>. 286N/A * @param classLoader <code>ClassLoader</code> used to load the factory class. If <code>null</code> 286N/A * current <code>Thread</code>'s context classLoader is used to load the factory class. 286N/A * @return New instance of a <code>DatatypeFactory</code> 286N/A * @throws DatatypeConfigurationException if <code>factoryClassName</code> is <code>null</code>, or 286N/A * the factory class cannot be loaded, instantiated. 286N/A * <p>Obtain a new instance of a <code>Duration</code> 286N/A * specifying the <code>Duration</code> as its string representation, "PnYnMnDTnHnMnS", 286N/A * as defined in XML Schema 1.0 section 3.2.6.1.</p> 286N/A * <p>XML Schema Part 2: Datatypes, 3.2.6 duration, defines <code>duration</code> as:</p> 286N/A * duration represents a duration of time. 286N/A * The value space of duration is a six-dimensional space where the coordinates designate the 286N/A * Gregorian year, month, day, hour, minute, and second components defined in Section 5.5.3.2 of [ISO 8601], respectively. 286N/A * These components are ordered in their significance by their order of appearance i.e. as 286N/A * year, month, day, hour, minute, and second. 286N/A * <p>All six values are set and availabe from the created {@link Duration}</p> 286N/A * <p>The XML Schema specification states that values can be of an arbitrary size. 286N/A * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values. 286N/A * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits 286N/A * if implementation capacities are exceeded.</p> 286N/A * @param lexicalRepresentation <code>String</code> representation of a <code>Duration</code>. 286N/A * @return New <code>Duration</code> created from parsing the <code>lexicalRepresentation</code>. 286N/A * @throws IllegalArgumentException If <code>lexicalRepresentation</code> is not a valid representation of a <code>Duration</code>. 286N/A * @throws UnsupportedOperationException If implementation cannot support requested values. 286N/A * @throws NullPointerException if <code>lexicalRepresentation</code> is <code>null</code>. 286N/A * <p>Obtain a new instance of a <code>Duration</code> 286N/A * specifying the <code>Duration</code> as milliseconds.</p> 286N/A * <p>XML Schema Part 2: Datatypes, 3.2.6 duration, defines <code>duration</code> as:</p> 286N/A * duration represents a duration of time. 286N/A * The value space of duration is a six-dimensional space where the coordinates designate the 286N/A * Gregorian year, month, day, hour, minute, and second components defined in Section 5.5.3.2 of [ISO 8601], respectively. 286N/A * These components are ordered in their significance by their order of appearance i.e. as 286N/A * year, month, day, hour, minute, and second. 286N/A * <p>All six values are set by computing their values from the specified milliseconds 286N/A * and are availabe using the <code>get</code> methods of the created {@link Duration}. 286N/A * The values conform to and are defined by:</p> 286N/A * <li>ISO 8601:2000(E) Section 5.5.3.2 Alternative format</li> 286N/A * W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats</a> 286N/A * <li>{@link XMLGregorianCalendar} Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation</li> 286N/A * <p>The default start instance is defined by {@link GregorianCalendar}'s use of the start of the epoch: i.e., 286N/A * {@link java.util.Calendar#YEAR} = 1970, 286N/A * {@link java.util.Calendar#MONTH} = {@link java.util.Calendar#JANUARY}, 286N/A * {@link java.util.Calendar#DATE} = 1, etc. 286N/A * This is important as there are variations in the Gregorian Calendar, 286N/A * e.g. leap years have different days in the month = {@link java.util.Calendar#FEBRUARY} 286N/A * so the result of {@link Duration#getMonths()} and {@link Duration#getDays()} can be influenced.</p> 286N/A * @param durationInMilliSeconds Duration in milliseconds to create. 286N/A * @return New <code>Duration</code> representing <code>durationInMilliSeconds</code>. 286N/A * <p>Obtain a new instance of a <code>Duration</code> 286N/A * specifying the <code>Duration</code> as isPositive, years, months, days, hours, minutes, seconds.</p> 286N/A * <p>The XML Schema specification states that values can be of an arbitrary size. 286N/A * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values. 286N/A * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits 286N/A * if implementation capacities are exceeded.</p> 286N/A * <p>A <code>null</code> value indicates that field is not set.</p> 286N/A * @param isPositive Set to <code>false</code> to create a negative duration. When the length 286N/A * of the duration is zero, this parameter will be ignored. 286N/A * @param years of this <code>Duration</code> 286N/A * @param months of this <code>Duration</code> 286N/A * @param days of this <code>Duration</code> 286N/A * @param hours of this <code>Duration</code> 286N/A * @param minutes of this <code>Duration</code> 286N/A * @param seconds of this <code>Duration</code> 286N/A * @return New <code>Duration</code> created from the specified values. 286N/A * @throws IllegalArgumentException If the values are not a valid representation of a 286N/A * <code>Duration</code>: if all the fields (years, months, ...) are null or 286N/A * if any of the fields is negative. 286N/A * @throws UnsupportedOperationException If implementation cannot support requested values. 286N/A * <p>Obtain a new instance of a <code>Duration</code> 286N/A * specifying the <code>Duration</code> as isPositive, years, months, days, hours, minutes, seconds.</p> 286N/A * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p> 286N/A * @param isPositive Set to <code>false</code> to create a negative duration. When the length 286N/A * of the duration is zero, this parameter will be ignored. 286N/A * @param years of this <code>Duration</code> 286N/A * @param months of this <code>Duration</code> 286N/A * @param days of this <code>Duration</code> 286N/A * @param hours of this <code>Duration</code> 286N/A * @param minutes of this <code>Duration</code> 286N/A * @param seconds of this <code>Duration</code> 286N/A * @return New <code>Duration</code> created from the specified values. 286N/A * @throws IllegalArgumentException If the values are not a valid representation of a 286N/A * <code>Duration</code>: if any of the fields is negative. 286N/A // years may not be set 286N/A // months may not be set 286N/A // hours may not be set 286N/A // minutes may not be set 286N/A // seconds may not be set 286N/A * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> by parsing its <code>String</code> representation, 286N/A * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p> 286N/A * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code> 286N/A * whose lexical representation contains only day, hour, minute, and second components. 286N/A * <p>All four values are set and availabe from the created {@link Duration}</p> 286N/A * <p>The XML Schema specification states that values can be of an arbitrary size. 286N/A * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values. 286N/A * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits 286N/A * if implementation capacities are exceeded.</p> 286N/A * @param lexicalRepresentation Lexical representation of a duration. 286N/A * @return New <code>Duration</code> created using the specified <code>lexicalRepresentation</code>. 286N/A * @throws IllegalArgumentException If <code>lexicalRepresentation</code> is not a valid representation of a <code>Duration</code> expressed only in terms of days and time. 286N/A * @throws UnsupportedOperationException If implementation cannot support requested values. 286N/A * @throws NullPointerException If <code>lexicalRepresentation</code> is <code>null</code>. 286N/A // lexicalRepresentation must be non-null 286N/A "Trying to create an xdt:dayTimeDuration with an invalid" 286N/A +
" lexical representation of \"null\"");
286N/A // test lexicalRepresentation against spec regex 286N/A "Trying to create an xdt:dayTimeDuration with an invalid" 286N/A +
"\", data model requires years and months only.");
286N/A * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> using the specified milliseconds as defined in 286N/A * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p> 286N/A * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code> 286N/A * whose lexical representation contains only day, hour, minute, and second components. 286N/A * <p>All four values are set by computing their values from the specified milliseconds 286N/A * and are availabe using the <code>get</code> methods of the created {@link Duration}. 286N/A * The values conform to and are defined by:</p> 286N/A * <li>ISO 8601:2000(E) Section 5.5.3.2 Alternative format</li> 286N/A * W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats</a> 286N/A * <li>{@link XMLGregorianCalendar} Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation</li> 286N/A * <p>The default start instance is defined by {@link GregorianCalendar}'s use of the start of the epoch: i.e., 286N/A * {@link java.util.Calendar#YEAR} = 1970, 286N/A * {@link java.util.Calendar#MONTH} = {@link java.util.Calendar#JANUARY}, 286N/A * {@link java.util.Calendar#DATE} = 1, etc. 286N/A * This is important as there are variations in the Gregorian Calendar, 286N/A * e.g. leap years have different days in the month = {@link java.util.Calendar#FEBRUARY} 286N/A * so the result of {@link Duration#getDays()} can be influenced.</p> 286N/A * <p>Any remaining milliseconds after determining the day, hour, minute and second are discarded.</p> 286N/A * @param durationInMilliseconds Milliseconds of <code>Duration</code> to create. 286N/A * @return New <code>Duration</code> created with the specified <code>durationInMilliseconds</code>. 286N/A * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a> 286N/A * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> using the specified 286N/A * <code>day</code>, <code>hour</code>, <code>minute</code> and <code>second</code> as defined in 286N/A * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p> 286N/A * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code> 286N/A * whose lexical representation contains only day, hour, minute, and second components. 286N/A * <p>The XML Schema specification states that values can be of an arbitrary size. 286N/A * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values. 286N/A * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits 286N/A * if implementation capacities are exceeded.</p> 286N/A * <p>A <code>null</code> value indicates that field is not set.</p> 286N/A * @param isPositive Set to <code>false</code> to create a negative duration. When the length 286N/A * of the duration is zero, this parameter will be ignored. 286N/A * @param day Day of <code>Duration</code>. 286N/A * @param hour Hour of <code>Duration</code>. 286N/A * @param minute Minute of <code>Duration</code>. 286N/A * @param second Second of <code>Duration</code>. 286N/A * @return New <code>Duration</code> created with the specified <code>day</code>, <code>hour</code>, <code>minute</code> 286N/A * and <code>second</code>. 286N/A * @throws IllegalArgumentException If the values are not a valid representation of a 286N/A * <code>Duration</code>: if all the fields (day, hour, ...) are null or 286N/A * if any of the fields is negative. 286N/A * @throws UnsupportedOperationException If implementation cannot support requested values. 286N/A * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> using the specified 286N/A * <code>day</code>, <code>hour</code>, <code>minute</code> and <code>second</code> as defined in 286N/A * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p> 286N/A * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code> 286N/A * whose lexical representation contains only day, hour, minute, and second components. 286N/A * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p> 286N/A * @param isPositive Set to <code>false</code> to create a negative duration. When the length 286N/A * of the duration is zero, this parameter will be ignored. 286N/A * @param day Day of <code>Duration</code>. 286N/A * @param hour Hour of <code>Duration</code>. 286N/A * @param minute Minute of <code>Duration</code>. 286N/A * @param second Second of <code>Duration</code>. 286N/A * @return New <code>Duration</code> created with the specified <code>day</code>, <code>hour</code>, <code>minute</code> 286N/A * and <code>second</code>. 286N/A * @throws IllegalArgumentException If the values are not a valid representation of a 286N/A * <code>Duration</code>: if any of the fields (day, hour, ...) is negative. 286N/A * <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> by parsing its <code>String</code> representation, 286N/A * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p> 286N/A * <p>The datatype <code>xdt:yearMonthDuration</code> is a subtype of <code>xs:duration</code> 286N/A * whose lexical representation contains only year and month components. 286N/A * This datatype resides in the namespace {@link javax.xml.XMLConstants#W3C_XPATH_DATATYPE_NS_URI}.</p> 286N/A * <p>Both values are set and availabe from the created {@link Duration}</p> 286N/A * <p>The XML Schema specification states that values can be of an arbitrary size. 286N/A * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values. 286N/A * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits 286N/A * if implementation capacities are exceeded.</p> 286N/A * @param lexicalRepresentation Lexical representation of a duration. 286N/A * @return New <code>Duration</code> created using the specified <code>lexicalRepresentation</code>. 286N/A * @throws IllegalArgumentException If <code>lexicalRepresentation</code> is not a valid representation of a <code>Duration</code> expressed only in terms of years and months. 286N/A * @throws UnsupportedOperationException If implementation cannot support requested values. 286N/A * @throws NullPointerException If <code>lexicalRepresentation</code> is <code>null</code>. 286N/A // lexicalRepresentation must be non-null 286N/A "Trying to create an xdt:yearMonthDuration with an invalid" 286N/A +
" lexical representation of \"null\"");
286N/A // test lexicalRepresentation against spec regex 286N/A "Trying to create an xdt:yearMonthDuration with an invalid" 286N/A +
"\", data model requires days and times only.");
286N/A * <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> using the specified milliseconds as defined in 286N/A * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p> 286N/A * <p>The datatype <code>xdt:yearMonthDuration</code> is a subtype of <code>xs:duration</code> 286N/A * whose lexical representation contains only year and month components. 286N/A * This datatype resides in the namespace {@link javax.xml.XMLConstants#W3C_XPATH_DATATYPE_NS_URI}.</p> 286N/A * <p>Both values are set by computing their values from the specified milliseconds 286N/A * and are availabe using the <code>get</code> methods of the created {@link Duration}. 286N/A * The values conform to and are defined by:</p> 286N/A * <li>ISO 8601:2000(E) Section 5.5.3.2 Alternative format</li> 286N/A * W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats</a> 286N/A * <li>{@link XMLGregorianCalendar} Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation</li> 286N/A * <p>The default start instance is defined by {@link GregorianCalendar}'s use of the start of the epoch: i.e., 286N/A * {@link java.util.Calendar#YEAR} = 1970, 286N/A * {@link java.util.Calendar#MONTH} = {@link java.util.Calendar#JANUARY}, 286N/A * {@link java.util.Calendar#DATE} = 1, etc. 286N/A * This is important as there are variations in the Gregorian Calendar, 286N/A * e.g. leap years have different days in the month = {@link java.util.Calendar#FEBRUARY} 286N/A * so the result of {@link Duration#getMonths()} can be influenced.</p> 286N/A * <p>Any remaining milliseconds after determining the year and month are discarded.</p> 286N/A * @param durationInMilliseconds Milliseconds of <code>Duration</code> to create. 286N/A * @return New <code>Duration</code> created using the specified <code>durationInMilliseconds</code>. 286N/A // create a Duration that only has sign, year & month 286N/A // Duration is immutable, so need to create a new Duration 286N/A // implementations may override this method in a more efficient way 286N/A * <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> using the specified 286N/A * <code>year</code> and <code>month</code> as defined in 286N/A * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p> 286N/A * <p>The XML Schema specification states that values can be of an arbitrary size. 286N/A * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values. 286N/A * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits 286N/A * if implementation capacities are exceeded.</p> 286N/A * <p>A <code>null</code> value indicates that field is not set.</p> 286N/A * @param isPositive Set to <code>false</code> to create a negative duration. When the length 286N/A * of the duration is zero, this parameter will be ignored. 286N/A * @param year Year of <code>Duration</code>. 286N/A * @param month Month of <code>Duration</code>. 286N/A * @return New <code>Duration</code> created using the specified <code>year</code> and <code>month</code>. 286N/A * @throws IllegalArgumentException If the values are not a valid representation of a 286N/A * <code>Duration</code>: if all of the fields (year, month) are null or 286N/A * if any of the fields is negative. 286N/A * @throws UnsupportedOperationException If implementation cannot support requested values. 286N/A * <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> using the specified 286N/A * <code>year</code> and <code>month</code> as defined in 286N/A * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p> 286N/A * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p> 286N/A * @param isPositive Set to <code>false</code> to create a negative duration. When the length 286N/A * of the duration is zero, this parameter will be ignored. 286N/A * @param year Year of <code>Duration</code>. 286N/A * @param month Month of <code>Duration</code>. 286N/A * @return New <code>Duration</code> created using the specified <code>year</code> and <code>month</code>. 286N/A * @throws IllegalArgumentException If the values are not a valid representation of a 286N/A * <code>Duration</code>: if any of the fields (year, month) is negative. 286N/A * <p>Create a new instance of an <code>XMLGregorianCalendar</code>.</p> 286N/A * <p>All date/time datatype fields set to {@link DatatypeConstants#FIELD_UNDEFINED} or null.</p> 286N/A * @return New <code>XMLGregorianCalendar</code> with all date/time datatype fields set to 286N/A * {@link DatatypeConstants#FIELD_UNDEFINED} or null. 286N/A * <p>Create a new XMLGregorianCalendar by parsing the String as a lexical representation.</p> 286N/A * <p>Parsing the lexical string representation is defined in 286N/A * <em>Lexical Representation</em>.</a></p> 286N/A * <p>The string representation may not have any leading and trailing whitespaces.</p> 286N/A * <p>The parsing is done field by field so that 286N/A * the following holds for any lexically correct String x:</p> 286N/A * newXMLGregorianCalendar(x).toXMLFormat().equals(x) 286N/A * XML Schema 1.0 errata, Section 3.2.7.2</a>.</p> 286N/A * @param lexicalRepresentation Lexical representation of one the eight XML Schema date/time datatypes. 286N/A * @return <code>XMLGregorianCalendar</code> created from the <code>lexicalRepresentation</code>. 286N/A * @throws IllegalArgumentException If the <code>lexicalRepresentation</code> is not a valid <code>XMLGregorianCalendar</code>. 286N/A * @throws NullPointerException If <code>lexicalRepresentation</code> is <code>null</code>. 286N/A * <p>Create an <code>XMLGregorianCalendar</code> from a {@link GregorianCalendar}.</p> 286N/A * <table border="2" rules="all" cellpadding="2"> 286N/A * <th align="center" colspan="2"> 286N/A * Field by Field Conversion from 286N/A * {@link GregorianCalendar} to an {@link XMLGregorianCalendar} 286N/A * <th><code>java.util.GregorianCalendar</code> field</th> 286N/A * <td><code>ERA == GregorianCalendar.BC ? -YEAR : YEAR</code></td> 286N/A * <td>{@link XMLGregorianCalendar#setYear(int year)}</td> 286N/A * <td><code>MONTH + 1</code></td> 286N/A * <td>{@link XMLGregorianCalendar#setMonth(int month)}</td> 286N/A * <td><code>DAY_OF_MONTH</code></td> 286N/A * <td>{@link XMLGregorianCalendar#setDay(int day)}</td> 286N/A * <td><code>HOUR_OF_DAY, MINUTE, SECOND, MILLISECOND</code></td> 286N/A * <td>{@link XMLGregorianCalendar#setTime(int hour, int minute, int second, BigDecimal fractional)}</td> 286N/A * <code>(ZONE_OFFSET + DST_OFFSET) / (60*1000)</code><br/> 286N/A * <em>(in minutes)</em> 286N/A * <td>{@link XMLGregorianCalendar#setTimezone(int offset)}<sup><em>*</em></sup> 286N/A * <p><em>*</em>conversion loss of information. It is not possible to represent 286N/A * a <code>java.util.GregorianCalendar</code> daylight savings timezone id in the 286N/A * <p>To compute the return value's <code>TimeZone</code> field, 286N/A * <li>when <code>this.getTimezone() != FIELD_UNDEFINED</code>, 286N/A * create a <code>java.util.TimeZone</code> with a custom timezone id 286N/A * using the <code>this.getTimezone()</code>.</li> 286N/A * <li>else use the <code>GregorianCalendar</code> default timezone value 286N/A * for the host is defined as specified by 286N/A * <code>java.util.TimeZone.getDefault()</code>.</li></p> 286N/A * @param cal <code>java.util.GregorianCalendar</code> used to create <code>XMLGregorianCalendar</code> 286N/A * @return <code>XMLGregorianCalendar</code> created from <code>java.util.GregorianCalendar</code> 286N/A * @throws NullPointerException If <code>cal</code> is <code>null</code>. 286N/A * <p>Constructor allowing for complete value spaces allowed by 286N/A * W3C XML Schema 1.0 recommendation for xsd:dateTime and related 286N/A * builtin datatypes. Note that <code>year</code> parameter supports 286N/A * arbitrarily large numbers and fractionalSecond has infinite 286N/A * <p>A <code>null</code> value indicates that field is not set.</p> 286N/A * @param year of <code>XMLGregorianCalendar</code> to be created. 286N/A * @param month of <code>XMLGregorianCalendar</code> to be created. 286N/A * @param day of <code>XMLGregorianCalendar</code> to be created. 286N/A * @param hour of <code>XMLGregorianCalendar</code> to be created. 286N/A * @param minute of <code>XMLGregorianCalendar</code> to be created. 286N/A * @param second of <code>XMLGregorianCalendar</code> to be created. 286N/A * @param fractionalSecond of <code>XMLGregorianCalendar</code> to be created. 286N/A * @param timezone of <code>XMLGregorianCalendar</code> to be created. 286N/A * @return <code>XMLGregorianCalendar</code> created from specified values. 286N/A * @throws IllegalArgumentException If any individual parameter's value is outside the maximum value constraint for the field 286N/A * as determined by the Date/Time Data Mapping table in {@link XMLGregorianCalendar} 286N/A * or if the composite values constitute an invalid <code>XMLGregorianCalendar</code> instance 286N/A * as determined by {@link XMLGregorianCalendar#isValid()}. 286N/A * <p>Constructor of value spaces that a 286N/A * <code>java.util.GregorianCalendar</code> instance would need to convert to an 286N/A * <code>XMLGregorianCalendar</code> instance.</p> 286N/A * <p><code>XMLGregorianCalendar eon</code> and 286N/A * <code>fractionalSecond</code> are set to <code>null</code></p> 286N/A * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p> 286N/A * @param year of <code>XMLGregorianCalendar</code> to be created. 286N/A * @param month of <code>XMLGregorianCalendar</code> to be created. 286N/A * @param day of <code>XMLGregorianCalendar</code> to be created. 286N/A * @param hour of <code>XMLGregorianCalendar</code> to be created. 286N/A * @param minute of <code>XMLGregorianCalendar</code> to be created. 286N/A * @param second of <code>XMLGregorianCalendar</code> to be created. 286N/A * @param millisecond of <code>XMLGregorianCalendar</code> to be created. 286N/A * @param timezone of <code>XMLGregorianCalendar</code> to be created. 286N/A * @return <code>XMLGregorianCalendar</code> created from specified values. 286N/A * @throws IllegalArgumentException If any individual parameter's value is outside the maximum value constraint for the field 286N/A * as determined by the Date/Time Data Mapping table in {@link XMLGregorianCalendar} 286N/A * or if the composite values constitute an invalid <code>XMLGregorianCalendar</code> instance 286N/A * as determined by {@link XMLGregorianCalendar#isValid()}. 286N/A // year may be undefined 286N/A // millisecond may be undefined 286N/A // millisecond must be >= 0 millisecond <= 1000 286N/A +
"int year, int month, int day, int hour, int minute, int second, int millisecond, int timezone)" 286N/A * <p>Create a Java representation of XML Schema builtin datatype <code>date</code> or <code>g*</code>.</p> 286N/A * <p>For example, an instance of <code>gYear</code> can be created invoking this factory 286N/A * with <code>month</code> and <code>day</code> parameters set to 286N/A * {@link DatatypeConstants#FIELD_UNDEFINED}.</p> 286N/A * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p> 286N/A * @param year of <code>XMLGregorianCalendar</code> to be created. 286N/A * @param month of <code>XMLGregorianCalendar</code> to be created. 286N/A * @param day of <code>XMLGregorianCalendar</code> to be created. 286N/A * @param timezone offset in minutes. {@link DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set. 286N/A * @return <code>XMLGregorianCalendar</code> created from parameter values. 286N/A * @see DatatypeConstants#FIELD_UNDEFINED 286N/A * @throws IllegalArgumentException If any individual parameter's value is outside the maximum value constraint for the field 286N/A * as determined by the Date/Time Data Mapping table in {@link XMLGregorianCalendar} 286N/A * or if the composite values constitute an invalid <code>XMLGregorianCalendar</code> instance 286N/A * as determined by {@link XMLGregorianCalendar#isValid()}. 286N/A * <p>Create a Java instance of XML Schema builtin datatype <code>time</code>.</p> 286N/A * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p> 286N/A * @param hours number of hours 286N/A * @param minutes number of minutes 286N/A * @param seconds number of seconds 286N/A * @param timezone offset in minutes. {@link DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set. 286N/A * @return <code>XMLGregorianCalendar</code> created from parameter values. 286N/A * @throws IllegalArgumentException If any individual parameter's value is outside the maximum value constraint for the field 286N/A * as determined by the Date/Time Data Mapping table in {@link XMLGregorianCalendar} 286N/A * or if the composite values constitute an invalid <code>XMLGregorianCalendar</code> instance 286N/A * as determined by {@link XMLGregorianCalendar#isValid()}. 286N/A * @see DatatypeConstants#FIELD_UNDEFINED 286N/A * <p>Create a Java instance of XML Schema builtin datatype time.</p> 286N/A * <p>A <code>null</code> value indicates that field is not set.</p> 286N/A * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p> 286N/A * @param hours number of hours 286N/A * @param minutes number of minutes 286N/A * @param seconds number of seconds 286N/A * @param fractionalSecond value of <code>null</code> indicates that this optional field is not set. 286N/A * @param timezone offset in minutes. {@link DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set. 286N/A * @return <code>XMLGregorianCalendar</code> created from parameter values. 286N/A * @see DatatypeConstants#FIELD_UNDEFINED 286N/A * @throws IllegalArgumentException If any individual parameter's value is outside the maximum value constraint for the field 286N/A * as determined by the Date/Time Data Mapping table in {@link XMLGregorianCalendar} 286N/A * or if the composite values constitute an invalid <code>XMLGregorianCalendar</code> instance 286N/A * as determined by {@link XMLGregorianCalendar#isValid()}. 286N/A * <p>Create a Java instance of XML Schema builtin datatype time.</p> 286N/A * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p> 286N/A * @param hours number of hours 286N/A * @param minutes number of minutes 286N/A * @param seconds number of seconds 286N/A * @param milliseconds number of milliseconds 286N/A * @param timezone offset in minutes. {@link DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set. 286N/A * @return <code>XMLGregorianCalendar</code> created from parameter values. 286N/A * @see DatatypeConstants#FIELD_UNDEFINED 286N/A * @throws IllegalArgumentException If any individual parameter's value is outside the maximum value constraint for the field 286N/A * as determined by the Date/Time Data Mapping table in {@link XMLGregorianCalendar} 286N/A * or if the composite values constitute an invalid <code>XMLGregorianCalendar</code> instance 286N/A * as determined by {@link XMLGregorianCalendar#isValid()}. 286N/A // millisecond may be undefined 286N/A // millisecond must be >= 0 millisecond <= 1000 286N/A +
"int hours, int minutes, int seconds, int milliseconds, int timezone)"