javax.xml.datatype
public abstract class DatatypeFactory extends Object
Factory that creates new javax.xml.datatype
Object
s that map XML to/from Java Object
s.
{@link #newInstance()} is used to create a new DatatypeFactory
.
The following implementation resolution mechanisms are used in the following order:
javax.xml.datatype.DatatypeFactory
",
exists, a class with the name of the property's value is instantiated.
Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}.
Object
.
The Properties
Object
is then queried for the property as documented in the prior step
and processed as documented in the prior step.
META-INF/services/java.xml.datatype.DatatypeFactory
.
Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}.
Class
specified by
{@link #DATATYPEFACTORY_IMPLEMENTATION_CLASS}, "javax.xml.datatype.DatatypeFactoryImpl
".
Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}.
Since: 1.5
Version: $Revision: 226183 $, $Date: 2005-04-08 06:39:14 -0400 (Fri, 08 Apr 2005) $
Field Summary | |
---|---|
static String | DATATYPEFACTORY_IMPLEMENTATION_CLASS Default implementation class name as defined in JSR 206: Java(TM) API for XML Processing (JAXP) 1.3. Default value is |
static String | DATATYPEFACTORY_PROPERTY Default property name as defined in JSR 206: Java(TM) API for XML Processing (JAXP) 1.3. Default value is |
Constructor Summary | |
---|---|
protected | DatatypeFactory() Protected constructor to prevent instaniation outside of package. Use {@link #newInstance()} to create a |
Method Summary | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
abstract Duration | newDuration(String lexicalRepresentation) Obtain a new instance of a XML Schema Part 2: Datatypes, 3.2.6 duration, defines duration represents a duration of time. | |||||||||||||||||||||||||||||||
abstract Duration | newDuration(long durationInMilliSeconds) Obtain a new instance of a XML Schema Part 2: Datatypes, 3.2.6 duration, defines duration represents a duration of time. | |||||||||||||||||||||||||||||||
abstract Duration | newDuration(boolean isPositive, BigInteger years, BigInteger months, BigInteger days, BigInteger hours, BigInteger minutes, BigDecimal seconds) Obtain a new instance of a The XML Schema specification states that values can be of an arbitrary size. | |||||||||||||||||||||||||||||||
Duration | newDuration(boolean isPositive, int years, int months, int days, int hours, int minutes, int seconds) Obtain a new instance of a A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field isnot set. | |||||||||||||||||||||||||||||||
Duration | newDurationDayTime(String lexicalRepresentation) Create a The datatype | |||||||||||||||||||||||||||||||
Duration | newDurationDayTime(long durationInMilliseconds) Create a The datatype | |||||||||||||||||||||||||||||||
Duration | newDurationDayTime(boolean isPositive, BigInteger day, BigInteger hour, BigInteger minute, BigInteger second) Create a The datatype | |||||||||||||||||||||||||||||||
Duration | newDurationDayTime(boolean isPositive, int day, int hour, int minute, int second) Create a The datatype | |||||||||||||||||||||||||||||||
Duration | newDurationYearMonth(String lexicalRepresentation) Create a The datatype | |||||||||||||||||||||||||||||||
Duration | newDurationYearMonth(long durationInMilliseconds) Create a The datatype | |||||||||||||||||||||||||||||||
Duration | newDurationYearMonth(boolean isPositive, BigInteger year, BigInteger month) Create a The XML Schema specification states that values can be of an arbitrary size. | |||||||||||||||||||||||||||||||
Duration | newDurationYearMonth(boolean isPositive, int year, int month) Create a A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field isnot set. | |||||||||||||||||||||||||||||||
static DatatypeFactory | newInstance() Obtain a new instance of a The implementation resolution mechanisms are defined in this
| |||||||||||||||||||||||||||||||
abstract XMLGregorianCalendar | newXMLGregorianCalendar() Create a new instance of an All date/time datatype fields set to {@link DatatypeConstants#FIELD_UNDEFINED} or null. | |||||||||||||||||||||||||||||||
abstract XMLGregorianCalendar | newXMLGregorianCalendar(String lexicalRepresentation) Create a new XMLGregorianCalendar by parsing the String as a lexical representation. Parsing the lexical string representation is defined in XML Schema 1.0 Part 2, Section 3.2.[7-14].1, Lexical Representation. The string representation may not have any leading and trailing whitespaces. The parsing is done field by field so that the following holds for any lexically correct String x: newXMLGregorianCalendar(x).toXMLFormat().equals(x) Except for the noted lexical/canonical representation mismatches listed in XML Schema 1.0 errata, Section 3.2.7.2. | |||||||||||||||||||||||||||||||
abstract XMLGregorianCalendar | newXMLGregorianCalendar(GregorianCalendar cal) Create an
Field DetailDATATYPEFACTORY_IMPLEMENTATION_CLASSpublic static final String DATATYPEFACTORY_IMPLEMENTATION_CLASS
Default implementation class name as defined in JSR 206: Java(TM) API for XML Processing (JAXP) 1.3. Default value is DATATYPEFACTORY_PROPERTYpublic static final String DATATYPEFACTORY_PROPERTY
Default property name as defined in JSR 206: Java(TM) API for XML Processing (JAXP) 1.3. Default value is Constructor DetailDatatypeFactoryprotected DatatypeFactory()
Protected constructor to prevent instaniation outside of package. Use {@link #newInstance()} to create a Method DetailnewDurationpublic abstract Duration newDuration(String lexicalRepresentation)
Obtain a new instance of a XML Schema Part 2: Datatypes, 3.2.6 duration, defines duration represents a duration of time. The value space of duration is a six-dimensional space where the coordinates designate the Gregorian year, month, day, hour, minute, and second components defined in Section 5.5.3.2 of [ISO 8601], respectively. These components are ordered in their significance by their order of appearance i.e. as year, month, day, hour, minute, and second. All six values are set and availabe from the created {@link Duration} The XML Schema specification states that values can be of an arbitrary size. Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values. An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits if implementation capacities are exceeded. Parameters: lexicalRepresentation Returns: New Throws: IllegalArgumentException If newDurationpublic abstract Duration newDuration(long durationInMilliSeconds)
Obtain a new instance of a XML Schema Part 2: Datatypes, 3.2.6 duration, defines duration represents a duration of time. The value space of duration is a six-dimensional space where the coordinates designate the Gregorian year, month, day, hour, minute, and second components defined in Section 5.5.3.2 of [ISO 8601], respectively. These components are ordered in their significance by their order of appearance i.e. as year, month, day, hour, minute, and second. All six values are set by computing their values from the specified milliseconds
and are availabe using the
The default start instance is defined by {@link GregorianCalendar}'s use of the start of the epoch: i.e., {@link java.util.Calendar#YEAR} = 1970, {@link java.util.Calendar#MONTH} = {@link java.util.Calendar#JANUARY}, {@link java.util.Calendar#DATE} = 1, etc. This is important as there are variations in the Gregorian Calendar, e.g. leap years have different days in the month = {@link java.util.Calendar#FEBRUARY} so the result of {@link Duration#getMonths()} and {@link Duration#getDays()} can be influenced. Parameters: durationInMilliSeconds Duration in milliseconds to create. Returns: New newDurationpublic abstract Duration newDuration(boolean isPositive, BigInteger years, BigInteger months, BigInteger days, BigInteger hours, BigInteger minutes, BigDecimal seconds)
Obtain a new instance of a The XML Schema specification states that values can be of an arbitrary size. Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values. An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits if implementation capacities are exceeded. A Parameters: isPositive Set to Returns: New Throws: IllegalArgumentException If values are not a valid representation of a newDurationpublic Duration newDuration(boolean isPositive, int years, int months, int days, int hours, int minutes, int seconds)
Obtain a new instance of a A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field isnot set. Parameters: isPositive Set to Returns: New Throws: IllegalArgumentException If values are not a valid representation of a See Also: DatatypeFactory newDurationDayTimepublic Duration newDurationDayTime(String lexicalRepresentation)
Create a The datatype All four values are set and availabe from the created {@link Duration} The XML Schema specification states that values can be of an arbitrary size. Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values. An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits if implementation capacities are exceeded. Parameters: lexicalRepresentation Lexical representation of a duration. Returns: New Throws: IllegalArgumentException If the given string does not conform to the aforementioned specification. UnsupportedOperationException If implementation cannot support requested values. NullPointerException If newDurationDayTimepublic Duration newDurationDayTime(long durationInMilliseconds)
Create a The datatype All four values are set by computing their values from the specified milliseconds
and are availabe using the
The default start instance is defined by {@link GregorianCalendar}'s use of the start of the epoch: i.e., {@link java.util.Calendar#YEAR} = 1970, {@link java.util.Calendar#MONTH} = {@link java.util.Calendar#JANUARY}, {@link java.util.Calendar#DATE} = 1, etc. This is important as there are variations in the Gregorian Calendar, e.g. leap years have different days in the month = {@link java.util.Calendar#FEBRUARY} so the result of {@link Duration#getDays()} can be influenced. Any remaining milliseconds after determining the day, hour, minute and second are discarded. Parameters: durationInMilliseconds Milliseconds of Returns: New See Also: newDurationDayTimepublic Duration newDurationDayTime(boolean isPositive, BigInteger day, BigInteger hour, BigInteger minute, BigInteger second)
Create a The datatype The XML Schema specification states that values can be of an arbitrary size. Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values. An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits if implementation capacities are exceeded. A Parameters: isPositive Set to Returns: New Throws: IllegalArgumentException If any values would create an invalid newDurationDayTimepublic Duration newDurationDayTime(boolean isPositive, int day, int hour, int minute, int second)
Create a The datatype A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field isnot set. Parameters: isPositive Set to Returns: New Throws: IllegalArgumentException If any values would create an invalid newDurationYearMonthpublic Duration newDurationYearMonth(String lexicalRepresentation)
Create a The datatype Both values are set and availabe from the created {@link Duration} The XML Schema specification states that values can be of an arbitrary size. Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values. An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits if implementation capacities are exceeded. Parameters: lexicalRepresentation Lexical representation of a duration. Returns: New Throws: IllegalArgumentException If the newDurationYearMonthpublic Duration newDurationYearMonth(long durationInMilliseconds)
Create a The datatype Both values are set by computing their values from the specified milliseconds
and are availabe using the
The default start instance is defined by {@link GregorianCalendar}'s use of the start of the epoch: i.e., {@link java.util.Calendar#YEAR} = 1970, {@link java.util.Calendar#MONTH} = {@link java.util.Calendar#JANUARY}, {@link java.util.Calendar#DATE} = 1, etc. This is important as there are variations in the Gregorian Calendar, e.g. leap years have different days in the month = {@link java.util.Calendar#FEBRUARY} so the result of {@link Duration#getMonths()} can be influenced. Any remaining milliseconds after determining the year and month are discarded. Parameters: durationInMilliseconds Milliseconds of Returns: New newDurationYearMonthpublic Duration newDurationYearMonth(boolean isPositive, BigInteger year, BigInteger month)
Create a The XML Schema specification states that values can be of an arbitrary size. Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values. An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits if implementation capacities are exceeded. A Parameters: isPositive Set to Returns: New Throws: IllegalArgumentException If any values would create an invalid newDurationYearMonthpublic Duration newDurationYearMonth(boolean isPositive, int year, int month)
Create a A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field isnot set. Parameters: isPositive Set to Returns: New Throws: IllegalArgumentException If any values would create an invalid newInstancepublic static DatatypeFactory newInstance()
Obtain a new instance of a The implementation resolution mechanisms are defined in this
Returns: New instance of a Throws: DatatypeConfigurationException If the implementation is not available or cannot be instantiated. newXMLGregorianCalendarpublic abstract XMLGregorianCalendar newXMLGregorianCalendar()
Create a new instance of an All date/time datatype fields set to {@link DatatypeConstants#FIELD_UNDEFINED} or null. Returns: New newXMLGregorianCalendarpublic abstract XMLGregorianCalendar newXMLGregorianCalendar(String lexicalRepresentation)
Create a new XMLGregorianCalendar by parsing the String as a lexical representation. Parsing the lexical string representation is defined in XML Schema 1.0 Part 2, Section 3.2.[7-14].1, Lexical Representation. The string representation may not have any leading and trailing whitespaces. The parsing is done field by field so that the following holds for any lexically correct String x: newXMLGregorianCalendar(x).toXMLFormat().equals(x) Except for the noted lexical/canonical representation mismatches listed in XML Schema 1.0 errata, Section 3.2.7.2. Parameters: lexicalRepresentation Lexical representation of one the eight XML Schema date/time datatypes. Returns: Throws: IllegalArgumentException If the newXMLGregorianCalendarpublic abstract XMLGregorianCalendar newXMLGregorianCalendar(GregorianCalendar cal)
Create an
*conversion loss of information. It is not possible to represent
a To compute the return value's
Parameters: cal Returns: Throws: NullPointerException If newXMLGregorianCalendarpublic abstract XMLGregorianCalendar newXMLGregorianCalendar(BigInteger year, int month, int day, int hour, int minute, int second, BigDecimal fractionalSecond, int timezone)
Constructor allowing for complete value spaces allowed by
W3C XML Schema 1.0 recommendation for xsd:dateTime and related
builtin datatypes. Note that A Parameters: year of Returns: Throws: 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 {@link XMLGregorianCalendar}
or if the composite values constitute an invalid newXMLGregorianCalendarpublic XMLGregorianCalendar newXMLGregorianCalendar(int year, int month, int day, int hour, int minute, int second, int millisecond, int timezone)
Constructor of value spaces that a
A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field isnot set. Parameters: year of Returns: Throws: 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 {@link XMLGregorianCalendar}
or if the composite values constitute an invalid newXMLGregorianCalendarDatepublic XMLGregorianCalendar newXMLGregorianCalendarDate(int year, int month, int day, int timezone)
Create a Java representation of XML Schema builtin datatype For example, an instance of A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field isnot set. Parameters: year of Returns: Throws: 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 {@link XMLGregorianCalendar}
or if the composite values constitute an invalid See Also: FIELD_UNDEFINED newXMLGregorianCalendarTimepublic XMLGregorianCalendar newXMLGregorianCalendarTime(int hours, int minutes, int seconds, int timezone)
Create a Java instance of XML Schema builtin datatype A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field isnot set. Parameters: hours number of hours minutes number of minutes seconds number of seconds timezone offset in minutes. {@link DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set. Returns: Throws: 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 {@link XMLGregorianCalendar}
or if the composite values constitute an invalid See Also: FIELD_UNDEFINED newXMLGregorianCalendarTimepublic XMLGregorianCalendar newXMLGregorianCalendarTime(int hours, int minutes, int seconds, BigDecimal fractionalSecond, int timezone)
Create a Java instance of XML Schema builtin datatype time. A A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field isnot set. Parameters: hours number of hours minutes number of minutes seconds number of seconds fractionalSecond value of Returns: Throws: 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 {@link XMLGregorianCalendar}
or if the composite values constitute an invalid See Also: FIELD_UNDEFINED newXMLGregorianCalendarTimepublic XMLGregorianCalendar newXMLGregorianCalendarTime(int hours, int minutes, int seconds, int milliseconds, int timezone)
Create a Java instance of XML Schema builtin datatype time. A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field isnot set. Parameters: hours number of hours minutes number of minutes seconds number of seconds milliseconds number of milliseconds timezone offset in minutes. {@link DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set. Returns: Throws: 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 {@link XMLGregorianCalendar}
or if the composite values constitute an invalid See Also: FIELD_UNDEFINED |