javax.xml.datatype

Class DatatypeFactory


public abstract class DatatypeFactory
extends Object

Factory class to create new datatype objects mapping XML to and from Java objects.
Since:
1.5

Field Summary

static String
DATATYPEFACTORY_IMPLEMENTATION_CLASS
JAXP 1.3 default implementation class name.
static String
DATATYPEFACTORY_PROPERTY
JAXP 1.3 default property name.

Constructor Summary

DatatypeFactory()
The basic constructor.

Method Summary

Duration
newDuration(boolean isPositive, int years, int months, int days, int hours, int minutes, int seconds)
Returns a new duration by specifying the individual components.
abstract Duration
newDuration(boolean isPositive, BigInteger years, BigInteger months, BigInteger days, BigInteger hours, BigInteger minutes, BigDecimal seconds)
Returns a new duration by specifying the individual components.
abstract Duration
newDuration(String lexicalRepresentation)
Returns a new duration from its string representation.
abstract Duration
newDuration(long durationInMilliSeconds)
Returns a new duration.
Duration
newDurationDayTime(boolean isPositive, int days, int hours, int minutes, int seconds)
Returns a new dayTimeDuration by specifying the individual components.
Duration
newDurationDayTime(boolean isPositive, BigInteger days, BigInteger hours, BigInteger minutes, BigInteger seconds)
Returns a new dayTimeDuration by specifying the individual components.
Duration
newDurationDayTime(String lexicalRepresentation)
Returns a new dayTimeDuration from its string representation.
Duration
newDurationDayTime(long durationInMilliseconds)
Returns a new dayTimeDuration.
Duration
newDurationYearMonth(boolean isPositive, int years, int months)
Returns a new yearMonthDuration by specifying the individual components.
Duration
newDurationYearMonth(boolean isPositive, BigInteger years, BigInteger months)
Returns a new yearMonthDuration by specifying the individual components.
Duration
newDurationYearMonth(String lexicalRepresentation)
Returns a new yearMonthDuration from its string representation.
Duration
newDurationYearMonth(long durationInMilliseconds)
Returns a new yearMonthDuration.
static DatatypeFactory
newInstance()
Returns a new factory instance.
abstract XMLGregorianCalendar
newXMLGregorianCalendar()
Returns a new XMLGregorianCalendar with no fields initialized.
XMLGregorianCalendar
newXMLGregorianCalendar(int year, int month, int day, int hour, int minute, int second, int millisecond, int timezone)
Returns a new XMLGregorianCalendar with the specified components.
abstract XMLGregorianCalendar
newXMLGregorianCalendar(String lexicalRepresentation)
Returns a new XMLGregorianCalendar from a string representation.
abstract XMLGregorianCalendar
newXMLGregorianCalendar(BigInteger year, int month, int day, int hour, int minute, int second, BigDecimal fractionalSecond, int timezone)
Returns a new XMLGregorianCalendar with the specified components.
abstract XMLGregorianCalendar
newXMLGregorianCalendar(GregorianCalendar cal)
Returns a new XMLGregorianCalendar based on the specified Gregorian calendar.
XMLGregorianCalendar
newXMLGregorianCalendarDate(int year, int month, int day, int timezone)
Returns a new XMLGregorianCalendar with the specified components.
XMLGregorianCalendar
newXMLGregorianCalendarTime(int hours, int minutes, int seconds, int timezone)
Returns a new XMLGregorianCalendar with the specified components.
XMLGregorianCalendar
newXMLGregorianCalendarTime(int hours, int minutes, int seconds, int milliseconds, int timezone)
Returns a new XMLGregorianCalendar with the specified components.
XMLGregorianCalendar
newXMLGregorianCalendarTime(int hours, int minutes, int seconds, BigDecimal fractionalSecond, int timezone)
Returns a new XMLGregorianCalendar with the specified components.

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

DATATYPEFACTORY_IMPLEMENTATION_CLASS

public static final String DATATYPEFACTORY_IMPLEMENTATION_CLASS
JAXP 1.3 default implementation class name.
Field Value:
"gnu.xml.datatype.JAXPDatatypeFactory"

DATATYPEFACTORY_PROPERTY

public static final String DATATYPEFACTORY_PROPERTY
JAXP 1.3 default property name.
Field Value:
"javax.xml.datatype.DatatypeFactory"

Constructor Details

DatatypeFactory

protected DatatypeFactory()
The basic constructor. Object is special, because it has no superclass, so there is no call to super().

Method Details

newDuration

public Duration newDuration(boolean isPositive,
                            int years,
                            int months,
                            int days,
                            int hours,
                            int minutes,
                            int seconds)
Returns a new duration by specifying the individual components.
Parameters:
isPositive - whether the duration is positive
years - the number of years
months - the number of months
days - the number of days
hours - the number of hours
minutes - th number of minutes
seconds - the number of seconds

newDuration

public abstract Duration newDuration(boolean isPositive,
                                     BigInteger years,
                                     BigInteger months,
                                     BigInteger days,
                                     BigInteger hours,
                                     BigInteger minutes,
                                     BigDecimal seconds)
Returns a new duration by specifying the individual components.
Parameters:
isPositive - whether the duration is positive
years - the number of years
months - the number of months
days - the number of days
hours - the number of hours
minutes - th number of minutes
seconds - the number of seconds

newDuration

public abstract Duration newDuration(String lexicalRepresentation)
Returns a new duration from its string representation.
Parameters:
lexicalRepresentation - the lexical representation of the duration, as specified in XML Schema 1.0 section 3.2.6.1.

newDuration

public abstract Duration newDuration(long durationInMilliSeconds)
Returns a new duration.
Parameters:
durationInMilliSeconds - the duration in milliseconds

newDurationDayTime

public Duration newDurationDayTime(boolean isPositive,
                                   int days,
                                   int hours,
                                   int minutes,
                                   int seconds)
Returns a new dayTimeDuration by specifying the individual components.
Parameters:
isPositive - whether the duration is positive
days - the number of days
hours - the number of hours
minutes - th number of minutes
seconds - the number of seconds

newDurationDayTime

public Duration newDurationDayTime(boolean isPositive,
                                   BigInteger days,
                                   BigInteger hours,
                                   BigInteger minutes,
                                   BigInteger seconds)
Returns a new dayTimeDuration by specifying the individual components.
Parameters:
isPositive - whether the duration is positive
days - the number of days
hours - the number of hours
minutes - th number of minutes
seconds - the number of seconds

newDurationDayTime

public Duration newDurationDayTime(String lexicalRepresentation)
Returns a new dayTimeDuration from its string representation.
Parameters:
lexicalRepresentation - the lexical representation of the duration, as specified in XML Schema 1.0 section 3.2.6.1.

newDurationDayTime

public Duration newDurationDayTime(long durationInMilliseconds)
Returns a new dayTimeDuration.
Parameters:
durationInMilliseconds - the duration in milliseconds

newDurationYearMonth

public Duration newDurationYearMonth(boolean isPositive,
                                     int years,
                                     int months)
Returns a new yearMonthDuration by specifying the individual components.
Parameters:
isPositive - whether the duration is positive
years - the number of years
months - the number of months

newDurationYearMonth

public Duration newDurationYearMonth(boolean isPositive,
                                     BigInteger years,
                                     BigInteger months)
Returns a new yearMonthDuration by specifying the individual components.
Parameters:
isPositive - whether the duration is positive
years - the number of years
months - the number of months

newDurationYearMonth

public Duration newDurationYearMonth(String lexicalRepresentation)
Returns a new yearMonthDuration from its string representation.
Parameters:
lexicalRepresentation - the lexical representation of the duration, as specified in XML Schema 1.0 section 3.2.6.1.

newDurationYearMonth

public Duration newDurationYearMonth(long durationInMilliseconds)
Returns a new yearMonthDuration.
Parameters:
durationInMilliseconds - the duration in milliseconds

newInstance

public static DatatypeFactory newInstance()
            throws DatatypeConfigurationException
Returns a new factory instance.

newXMLGregorianCalendar

public abstract XMLGregorianCalendar newXMLGregorianCalendar()
Returns a new XMLGregorianCalendar with no fields initialized.

newXMLGregorianCalendar

public XMLGregorianCalendar newXMLGregorianCalendar(int year,
                                                    int month,
                                                    int day,
                                                    int hour,
                                                    int minute,
                                                    int second,
                                                    int millisecond,
                                                    int timezone)
Returns a new XMLGregorianCalendar with the specified components.

newXMLGregorianCalendar

public abstract XMLGregorianCalendar newXMLGregorianCalendar(String lexicalRepresentation)
Returns a new XMLGregorianCalendar from a string representation.
Parameters:
lexicalRepresentation - the lexical representation as specified in XML Schema 1.0 Part 2, section 3.2.[7-14].1.

newXMLGregorianCalendar

public abstract XMLGregorianCalendar newXMLGregorianCalendar(BigInteger year,
                                                             int month,
                                                             int day,
                                                             int hour,
                                                             int minute,
                                                             int second,
                                                             BigDecimal fractionalSecond,
                                                             int timezone)
Returns a new XMLGregorianCalendar with the specified components.

newXMLGregorianCalendar

public abstract XMLGregorianCalendar newXMLGregorianCalendar(GregorianCalendar cal)
Returns a new XMLGregorianCalendar based on the specified Gregorian calendar.

newXMLGregorianCalendarDate

public XMLGregorianCalendar newXMLGregorianCalendarDate(int year,
                                                        int month,
                                                        int day,
                                                        int timezone)
Returns a new XMLGregorianCalendar with the specified components.

newXMLGregorianCalendarTime

public XMLGregorianCalendar newXMLGregorianCalendarTime(int hours,
                                                        int minutes,
                                                        int seconds,
                                                        int timezone)
Returns a new XMLGregorianCalendar with the specified components.

newXMLGregorianCalendarTime

public XMLGregorianCalendar newXMLGregorianCalendarTime(int hours,
                                                        int minutes,
                                                        int seconds,
                                                        int milliseconds,
                                                        int timezone)
Returns a new XMLGregorianCalendar with the specified components.

newXMLGregorianCalendarTime

public XMLGregorianCalendar newXMLGregorianCalendarTime(int hours,
                                                        int minutes,
                                                        int seconds,
                                                        BigDecimal fractionalSecond,
                                                        int timezone)
Returns a new XMLGregorianCalendar with the specified components.

DatatypeFactory.java -- Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.