org.apache.xerces.jaxp.datatype
public class DatatypeFactoryImpl extends DatatypeFactory
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}.
Version: $Id: DatatypeFactoryImpl.java,v 1.3 2005/06/06 04:45:59 mrglavas Exp $
Constructor Summary | |
---|---|
DatatypeFactoryImpl() Public constructor is empty.. Use {@link DatatypeFactory#newInstance()} to create a |
Method Summary | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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. | |||||||||||||||||||||
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. | |||||||||||||||||||||
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. | |||||||||||||||||||||
XMLGregorianCalendar | newXMLGregorianCalendar() Create a new instance of an All date/time datatype fields set to {@link DatatypeConstants#FIELD_UNDEFINED} or null. | |||||||||||||||||||||
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. | |||||||||||||||||||||
XMLGregorianCalendar | newXMLGregorianCalendar(GregorianCalendar cal) Create an
Constructor DetailDatatypeFactoryImplpublic DatatypeFactoryImpl()
Public constructor is empty.. Use {@link DatatypeFactory#newInstance()} to create a Method DetailnewDurationpublic 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 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 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. Parameters: isPositive Set to Returns: New Throws: IllegalArgumentException If values are not a valid representation of a See Also: DatatypeFactoryImpl newXMLGregorianCalendarpublic XMLGregorianCalendar newXMLGregorianCalendar()
Create a new instance of an All date/time datatype fields set to {@link DatatypeConstants#FIELD_UNDEFINED} or null. Returns: New newXMLGregorianCalendarpublic 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 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 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 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 Copyright © 1999-2005 Apache XML Project. All Rights Reserved.
|