Most visited

Recently visited

Added in API level 8

DatatypeFactory

public abstract class DatatypeFactory
extends Object

java.lang.Object
   ↳ javax.xml.datatype.DatatypeFactory


创建新的 javax.xml.datatype Object的工厂, javax.xml.datatype XML映射到/从Java Object s。

newInstance()用于创建新的DatatypeFactory 下列实施解决机制按以下顺序使用:

  1. If the system property specified by DATATYPEFACTORY_PROPERTY, "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 DatatypeConfigurationException.
  2. If the file ${JAVA_HOME}/lib/jaxp.properties exists, it is loaded in a Properties Object. The Properties Object is then queried for the property as documented in the prior step and processed as documented in the prior step.
  3. The services resolution mechanism is used, e.g. META-INF/services/java.xml.datatype.DatatypeFactory. Any Exception thrown during the instantiation process is wrapped as a DatatypeConfigurationException.
  4. The final mechanism is to attempt to instantiate the Class specified by DATATYPEFACTORY_IMPLEMENTATION_CLASS, "javax.xml.datatype.DatatypeFactoryImpl". Any Exception thrown during the instantiation process is wrapped as a DatatypeConfigurationException.

请注意,您必须提供您自己的实现(例如Xerces); Android不附带默认实现。

Summary

Constants

String DATATYPEFACTORY_PROPERTY

JSR 206中定义的默认属性名称:用于XML处理的Java(TM)API(JAXP)1.3。

Fields

public static final String DATATYPEFACTORY_IMPLEMENTATION_CLASS

JSR 206中定义的默认实现类名称:用于XML处理的Java(TM)API(JAXP)1.3。

Protected constructors

DatatypeFactory()

受保护的构造函数可防止包之外的实例化。

Public methods

abstract Duration newDuration(boolean isPositive, BigInteger years, BigInteger months, BigInteger days, BigInteger hours, BigInteger minutes, BigDecimal seconds)

获取 Duration的新实例,指定 Duration为正数,年,月,日,小时,分钟,秒。

Duration newDuration(boolean isPositive, int years, int months, int days, int hours, int minutes, int seconds)

获得一个 Duration的新实例,指定 Duration因为这是正数,年,月,日,小时,分钟,秒。

abstract Duration newDuration(long durationInMilliSeconds)

获取 Duration一个新实例,指定 Duration为毫秒。

abstract Duration newDuration(String lexicalRepresentation)

获得的新实例 Duration指定 Duration作为它的字符串表示,“PnYnMnDTnHnMnS”,如在XML模式1.0第3.2.6.1节定义。

Duration newDurationDayTime(long durationInMilliseconds)

创建 Duration类型的 xdt:dayTimeDuration使用指定毫秒中定义 XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration

Duration newDurationDayTime(boolean isPositive, BigInteger day, BigInteger hour, BigInteger minute, BigInteger second)

创建 Duration类型的 xdt:dayTimeDuration使用指定 dayhourminutesecond中定义 XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration

Duration newDurationDayTime(boolean isPositive, int day, int hour, int minute, int second)

创建 Duration类型的 xdt:dayTimeDuration使用指定 dayhourminutesecond中定义 XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration

Duration newDurationDayTime(String lexicalRepresentation)

创建 Durationxdt:dayTimeDuration通过分析其 String表示 ,“PnDTnHnMnS” XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration

Duration newDurationYearMonth(String lexicalRepresentation)

创建 Durationxdt:yearMonthDuration通过分析其 String表示 ,“PnYnM” XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration

Duration newDurationYearMonth(boolean isPositive, BigInteger year, BigInteger month)

创建 Duration类型的 xdt:yearMonthDuration使用指定 yearmonth中定义 XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration

Duration newDurationYearMonth(boolean isPositive, int year, int month)

创建 Duration类型的 xdt:yearMonthDuration使用指定 yearmonth中定义 XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration

Duration newDurationYearMonth(long durationInMilliseconds)

创建 Duration类型的 xdt:yearMonthDuration使用指定毫秒中定义 XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration

static DatatypeFactory newInstance(String factoryClassName, ClassLoader classLoader)

返回 DatatypeFactory的命名实现的 DatatypeFactory

static DatatypeFactory newInstance()

获取 DatatypeFactory的新实例。

abstract XMLGregorianCalendar newXMLGregorianCalendar(String lexicalRepresentation)

通过将字符串解析为词法表示来创建新的XMLGregorianCalendar。

abstract XMLGregorianCalendar newXMLGregorianCalendar(GregorianCalendar cal)

创建 XMLGregorianCalendarGregorianCalendar

XMLGregorianCalendar newXMLGregorianCalendar(int year, int month, int day, int hour, int minute, int second, int millisecond, int timezone)

java.util.GregorianCalendar实例需要转换为 XMLGregorianCalendar实例的值空间构造函数。

abstract XMLGregorianCalendar newXMLGregorianCalendar(BigInteger year, int month, int day, int hour, int minute, int second, BigDecimal fractionalSecond, int timezone)

W3C XML Schema 1.0关于xsd:dateTime和相关内置数据类型的建议允许完整的值空间。

abstract XMLGregorianCalendar newXMLGregorianCalendar()

创建一个 XMLGregorianCalendar的新实例。

XMLGregorianCalendar newXMLGregorianCalendarDate(int year, int month, int day, int timezone)

创建XML模式内置数据类型 dateg*的Java表示 g*

XMLGregorianCalendar newXMLGregorianCalendarTime(int hours, int minutes, int seconds, BigDecimal fractionalSecond, int timezone)

创建XML模式内置数据类型时间的Java实例。

XMLGregorianCalendar newXMLGregorianCalendarTime(int hours, int minutes, int seconds, int milliseconds, int timezone)

创建XML模式内置数据类型时间的Java实例。

XMLGregorianCalendar newXMLGregorianCalendarTime(int hours, int minutes, int seconds, int timezone)

创建XML模式内置数据类型 time的Java实例。

Inherited methods

From class java.lang.Object

Constants

DATATYPEFACTORY_PROPERTY

Added in API level 8
String DATATYPEFACTORY_PROPERTY

JSR 206中定义的默认属性名称:用于XML处理的Java(TM)API(JAXP)1.3。

默认值是 javax.xml.datatype.DatatypeFactory

常量值:“javax.xml.datatype.DatatypeFactory”

Fields

DATATYPEFACTORY_IMPLEMENTATION_CLASS

Added in API level 8
String DATATYPEFACTORY_IMPLEMENTATION_CLASS

JSR 206中定义的默认实现类名称:用于XML处理的Java(TM)API(JAXP)1.3。

默认值是 org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl

Protected constructors

DatatypeFactory

Added in API level 8
DatatypeFactory ()

受保护的构造函数可防止包之外的实例化。

使用 newInstance()创建 DatatypeFactory

Public methods

newDuration

Added in API level 8
Duration newDuration (boolean isPositive, 
                BigInteger years, 
                BigInteger months, 
                BigInteger days, 
                BigInteger hours, 
                BigInteger minutes, 
                BigDecimal seconds)

获取 Duration的新实例,指定 Duration为正数,年,月,日,小时,分钟,秒。

XML模式规范规定值可以是任意大小。 实现可能不选择或不能支持任意大的和/或小的值。 如果超过实施能力, UnsupportedOperationException将显示一条消息,指示实施限制。

值为 null表示该字段未设置。

Parameters
isPositive boolean: Set to false to create a negative duration. When the length of the duration is zero, this parameter will be ignored.
years BigInteger: of this Duration
months BigInteger: of this Duration
days BigInteger: of this Duration
hours BigInteger: of this Duration
minutes BigInteger: of this Duration
seconds BigDecimal: of this Duration
Returns
Duration New Duration created from the specified values.
Throws
IllegalArgumentException If values are not a valid representation of a Duration.
UnsupportedOperationException If implementation cannot support requested values.

newDuration

Added in API level 8
Duration newDuration (boolean isPositive, 
                int years, 
                int months, 
                int days, 
                int hours, 
                int minutes, 
                int seconds)

获取 Duration的新实例,指定 Duration为正数,年,月,日,时,分,秒。

一个 FIELD_UNDEFINED值表示该字段未设置。

Parameters
isPositive boolean: Set to false to create a negative duration. When the length of the duration is zero, this parameter will be ignored.
years int: of this Duration
months int: of this Duration
days int: of this Duration
hours int: of this Duration
minutes int: of this Duration
seconds int: of this Duration
Returns
Duration New Duration created from the specified values.
Throws
IllegalArgumentException If values are not a valid representation of a Duration.

也可以看看:

newDuration

Added in API level 8
Duration newDuration (long durationInMilliSeconds)

获取 Duration的新实例,指定 Duration为毫秒。

XML Schema第2部分:数据类型3.2.6持续时间定义 duration为:

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.

所有六个值都是通过从指定的毫秒计算它们的值来设置的,并且可以使用创建的Durationget方法来Duration 这些值符合并由以下定义:

默认启动实例由下式定义 GregorianCalendar的使用历元的开始的:即 YEAR = 1970, MONTH = JANUARYDATE = 1等由于有在格里历的变化这一点很重要,例如,闰年有该月中的不同日期= FEBRUARY因此可以影响 getMonths()getDays()的结果。

Parameters
durationInMilliSeconds long: Duration in milliseconds to create.
Returns
Duration New Duration representing durationInMilliSeconds.

newDuration

Added in API level 8
Duration newDuration (String lexicalRepresentation)

获取 Duration的新实例,指定 Duration作为其字符串表示形式“PnYnMnDTnHnMnS”,如XML模式1.0第3.2.6.1节中定义的那样。

XML Schema第2部分:数据类型3.2.6持续时间定义 duration为:

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.

所有六个值均已设置并可从创建的 Duration

XML模式规范规定值可以是任意大小。 实现可能不选择或不能支持任意大的和/或小的值。 如果超过实施能力, UnsupportedOperationException将被抛出一条消息,指示实施限制。

Parameters
lexicalRepresentation String: String representation of a Duration.
Returns
Duration New Duration created from parsing the lexicalRepresentation.
Throws
IllegalArgumentException If lexicalRepresentation is not a valid representation of a Duration.
UnsupportedOperationException If implementation cannot support requested values.
NullPointerException if lexicalRepresentation is null.

newDurationDayTime

Added in API level 8
Duration newDurationDayTime (long durationInMilliseconds)

创建 Duration类型的 xdt:dayTimeDuration使用指定毫秒中定义 XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration

数据类型xdt:dayTimeDuration是的子类型xs:duration其词汇表示仅包含日,小时,分,和第二组分。 此数据类型位于命名空间http://www.w3.org/2003/11/xpath-datatypes

所有四个值都是通过从指定的毫秒计算它们的值来设置的,并且可以使用创建的Durationget方法来Duration 这些值符合并由以下定义:

默认启动实例由下式定义 GregorianCalendar的使用历元的开始的:即 YEAR = 1970, MONTH = JANUARYDATE = 1等由于有在格里历的变化这一点很重要,例如,闰年有当月不同天= FEBRUARY这样的结果 getDays()会受到影响。

在确定日,小时,分钟和秒之后的任何剩余的毫秒将被丢弃。

Parameters
durationInMilliseconds long: Milliseconds of Duration to create.
Returns
Duration New Duration created with the specified durationInMilliseconds.

也可以看看:

newDurationDayTime

Added in API level 8
Duration newDurationDayTime (boolean isPositive, 
                BigInteger day, 
                BigInteger hour, 
                BigInteger minute, 
                BigInteger second)

创建 Duration类型的 xdt:dayTimeDuration使用指定 dayhourminutesecond中定义 XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration

数据类型xdt:dayTimeDuration是的子类型xs:duration其词汇表示仅包含日,小时,分,和第二组分。 此数据类型驻留在名称空间http://www.w3.org/2003/11/xpath-datatypes

XML模式规范规定值可以是任意大小。 实现可能不选择或不能支持任意大的和/或小的值。 UnsupportedOperationException将抛出一条消息,指出实施限制,如果超过执行能力。

值为 null表示该字段未设置。

Parameters
isPositive boolean: Set to false to create a negative duration. When the length of the duration is zero, this parameter will be ignored.
day BigInteger: Day of Duration.
hour BigInteger: Hour of Duration.
minute BigInteger: Minute of Duration.
second BigInteger: Second of Duration.
Returns
Duration New Duration created with the specified day, hour, minute and second.
Throws
IllegalArgumentException If any values would create an invalid Duration.
UnsupportedOperationException If implementation cannot support requested values.

newDurationDayTime

Added in API level 8
Duration newDurationDayTime (boolean isPositive, 
                int day, 
                int hour, 
                int minute, 
                int second)

创建 Duration类型的 xdt:dayTimeDuration使用指定 dayhourminutesecond中定义 XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration

数据类型xdt:dayTimeDuration是的子类型xs:duration其词汇表示仅包含日,小时,分,和第二组分。 此数据类型位于命名空间http://www.w3.org/2003/11/xpath-datatypes

值为 FIELD_UNDEFINED表示该字段未设置。

Parameters
isPositive boolean: Set to false to create a negative duration. When the length of the duration is zero, this parameter will be ignored.
day int: Day of Duration.
hour int: Hour of Duration.
minute int: Minute of Duration.
second int: Second of Duration.
Returns
Duration New Duration created with the specified day, hour, minute and second.
Throws
IllegalArgumentException If any values would create an invalid Duration.

newDurationDayTime

Added in API level 8
Duration newDurationDayTime (String lexicalRepresentation)

创建 Durationxdt:dayTimeDuration通过分析其 String表示 ,“PnDTnHnMnS” XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration

数据类型xdt:dayTimeDuration是的子类型xs:duration其词汇表示仅包含日,小时,分,和第二组分。 此数据类型位于命名空间http://www.w3.org/2003/11/xpath-datatypes

所有四个值都可以从创建的 Duration中设置和使用

XML模式规范规定值可以是任意大小。 实现可能不选择或不能支持任意大的和/或小的值。 一个UnsupportedOperationException将抛出一个消息,指出实施限制,如果超过执行能力。

Parameters
lexicalRepresentation String: Lexical representation of a duration.
Returns
Duration New Duration created using the specified lexicalRepresentation.
Throws
IllegalArgumentException If the given string does not conform to the aforementioned specification.
UnsupportedOperationException If implementation cannot support requested values.
NullPointerException If lexicalRepresentation is null.

newDurationYearMonth

Added in API level 8
Duration newDurationYearMonth (String lexicalRepresentation)

创建 Durationxdt:yearMonthDuration通过分析其 String表示 ,“PnYnM” XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration

数据类型xdt:yearMonthDuration是一个亚型xs:duration ,其词汇表示仅包含年份和月份组成部分。 此数据类型驻留在命名空间W3C_XPATH_DATATYPE_NS_URI

这两个值都可以从创建的 Duration中设置和使用

XML模式规范规定值可以是任意大小。 实现可能不选择或不能支持任意大的和/或小的值。 如果超过实施能力, UnsupportedOperationException将被抛出一条消息,指示实施限制。

Parameters
lexicalRepresentation String: Lexical representation of a duration.
Returns
Duration New Duration created using the specified lexicalRepresentation.
Throws
IllegalArgumentException If the lexicalRepresentation does not conform to the specification.
UnsupportedOperationException If implementation cannot support requested values.
NullPointerException If lexicalRepresentation is null.

newDurationYearMonth

Added in API level 8
Duration newDurationYearMonth (boolean isPositive, 
                BigInteger year, 
                BigInteger month)

创建 Duration类型的 xdt:yearMonthDuration使用指定 yearmonth中定义 XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration

XML模式规范规定值可以是任意大小。 实现可能不选择或不能支持任意大的和/或小的值。 一个UnsupportedOperationException将会抛出一条消息,指出如果实施能力被超过,实施限制。

null值表示该字段未设置。

Parameters
isPositive boolean: Set to false to create a negative duration. When the length of the duration is zero, this parameter will be ignored.
year BigInteger: Year of Duration.
month BigInteger: Month of Duration.
Returns
Duration New Duration created using the specified year and month.
Throws
IllegalArgumentException If any values would create an invalid Duration.
UnsupportedOperationException If implementation cannot support requested values.

newDurationYearMonth

Added in API level 8
Duration newDurationYearMonth (boolean isPositive, 
                int year, 
                int month)

创建 Duration类型的 xdt:yearMonthDuration使用指定 yearmonth中定义 XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration

值为 FIELD_UNDEFINED表示该字段未设置。

Parameters
isPositive boolean: Set to false to create a negative duration. When the length of the duration is zero, this parameter will be ignored.
year int: Year of Duration.
month int: Month of Duration.
Returns
Duration New Duration created using the specified year and month.
Throws
IllegalArgumentException If any values would create an invalid Duration.

newDurationYearMonth

Added in API level 8
Duration newDurationYearMonth (long durationInMilliseconds)

使用 Duration中定义的指定毫秒创建类型 xdt:yearMonthDurationDuration

数据类型xdt:yearMonthDuration是一个亚型xs:duration ,其词汇表示仅包含年份和月份组成部分。 此数据类型位于命名空间W3C_XPATH_DATATYPE_NS_URI

这两个值都是通过从指定的毫秒计算它们的值来设置的,并且可以使用创建的Durationget方法来Duration 这些值符合并由以下定义:

默认启动实例由下式定义 GregorianCalendar的使用历元的开始的:即 YEAR = 1970, MONTH = JANUARYDATE = 1等由于有在格里历的变化这一点很重要,例如,闰年有当月不同天= FEBRUARY这样的结果 getMonths()会受到影响。

放弃确定年份和月份后剩余的毫秒数。

Parameters
durationInMilliseconds long: Milliseconds of Duration to create.
Returns
Duration New Duration created using the specified durationInMilliseconds.

newInstance

Added in API level 9
DatatypeFactory newInstance (String factoryClassName, 
                ClassLoader classLoader)

返回 DatatypeFactory的命名实现的 DatatypeFactory

Parameters
factoryClassName String
classLoader ClassLoader
Returns
DatatypeFactory
Throws
DatatypeConfigurationException if factoryClassName is not available or cannot be instantiated.

newInstance

Added in API level 8
DatatypeFactory newInstance ()

获取 DatatypeFactory的新实例。

这个 Class的文档中的实现解决机制是 defined

请注意,您必须提供您自己的实现(例如Xerces); Android不附带默认实现。

Returns
DatatypeFactory New instance of a DocumentBuilderFactory
Throws
DatatypeConfigurationException If the implementation is not available or cannot be instantiated.

newXMLGregorianCalendar

Added in API level 8
XMLGregorianCalendar newXMLGregorianCalendar (String lexicalRepresentation)

通过将字符串解析为词法表示来创建新的XMLGregorianCalendar。

解析词法字符串表示在 XML Schema 1.0 Part 2, Section 3.2.[7-14].1, Lexical Representation.中定义

字符串表示可能没有任何前导和尾随空格。

解析是逐字段完成的,以便以下适用于任何词法正确的String x:

 newXMLGregorianCalendar(x).toXMLFormat().equals(x)
 

除了 XML Schema 1.0 errata, Section 3.2.7.2中列出的指出的词汇/规范表示不匹配 之外

Parameters
lexicalRepresentation String: Lexical representation of one the eight XML Schema date/time datatypes.
Returns
XMLGregorianCalendar XMLGregorianCalendar created from the lexicalRepresentation.
Throws
IllegalArgumentException If the lexicalRepresentation is not a valid XMLGregorianCalendar.
NullPointerException If lexicalRepresentation is null.

newXMLGregorianCalendar

Added in API level 8
XMLGregorianCalendar newXMLGregorianCalendar (GregorianCalendar cal)

创建 XMLGregorianCalendarGregorianCalendar

Field by Field Conversion from GregorianCalendar to an XMLGregorianCalendar
java.util.GregorianCalendar field javax.xml.datatype.XMLGregorianCalendar field
ERA == GregorianCalendar.BC ? -YEAR : YEAR setYear(int)
MONTH + 1 setMonth(int)
DAY_OF_MONTH setDay(int)
HOUR_OF_DAY, MINUTE, SECOND, MILLISECOND setTime(int, int, int, BigDecimal)
(ZONE_OFFSET + DST_OFFSET) / (60*1000)
(in minutes)
setTimezone(int)*

*转换信息丢失。 在XML Schema 1. java.util.GregorianCalendar期/时间数据类型表示中不能表示java.util.GregorianCalendar夏令java.util.GregorianCalendar区id。

要计算返回值的 TimeZone字段,

  • when this.getTimezone() != FIELD_UNDEFINED, create a java.util.TimeZone with a custom timezone id using the this.getTimezone().
  • else use the GregorianCalendar default timezone value for the host is defined as specified by java.util.TimeZone.getDefault().
  • Parameters
    cal GregorianCalendar: java.util.GregorianCalendar used to create XMLGregorianCalendar
    Returns
    XMLGregorianCalendar XMLGregorianCalendar created from java.util.GregorianCalendar
    Throws
    NullPointerException If cal is null.

newXMLGregorianCalendar

Added in API level 8
XMLGregorianCalendar newXMLGregorianCalendar (int year, 
                int month, 
                int day, 
                int hour, 
                int minute, 
                int second, 
                int millisecond, 
                int timezone)

java.util.GregorianCalendar实例需要转换为 XMLGregorianCalendar实例的值空间的构造函数。

XMLGregorianCalendar eonfractionalSecond设置为 null

值为 FIELD_UNDEFINED表示该字段未设置。

Parameters
year int: of XMLGregorianCalendar to be created.
month int: of XMLGregorianCalendar to be created.
day int: of XMLGregorianCalendar to be created.
hour int: of XMLGregorianCalendar to be created.
minute int: of XMLGregorianCalendar to be created.
second int: of XMLGregorianCalendar to be created.
millisecond int: of XMLGregorianCalendar to be created.
timezone int: of XMLGregorianCalendar to be created.
Returns
XMLGregorianCalendar XMLGregorianCalendar created from specified values.
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 XMLGregorianCalendar or if the composite values constitute an invalid XMLGregorianCalendar instance as determined by isValid().

newXMLGregorianCalendar

Added in API level 8
XMLGregorianCalendar newXMLGregorianCalendar (BigInteger year, 
                int month, 
                int day, 
                int hour, 
                int minute, 
                int second, 
                BigDecimal fractionalSecond, 
                int timezone)

W3C XML Schema 1.0关于xsd:dateTime和相关内置数据类型的建议允许完整的值空间。 请注意, year参数支持任意大数字,fractionalSecond具有无限精度。

值为 null表示该字段未设置。

Parameters
year BigInteger: of XMLGregorianCalendar to be created.
month int: of XMLGregorianCalendar to be created.
day int: of XMLGregorianCalendar to be created.
hour int: of XMLGregorianCalendar to be created.
minute int: of XMLGregorianCalendar to be created.
second int: of XMLGregorianCalendar to be created.
fractionalSecond BigDecimal: of XMLGregorianCalendar to be created.
timezone int: of XMLGregorianCalendar to be created.
Returns
XMLGregorianCalendar XMLGregorianCalendar created from specified values.
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 XMLGregorianCalendar or if the composite values constitute an invalid XMLGregorianCalendar instance as determined by isValid().

newXMLGregorianCalendar

Added in API level 8
XMLGregorianCalendar newXMLGregorianCalendar ()

创建一个 XMLGregorianCalendar的新实例。

所有日期/时间数据类型字段设置为 FIELD_UNDEFINED或为空。

Returns
XMLGregorianCalendar New XMLGregorianCalendar with all date/time datatype fields set to FIELD_UNDEFINED or null.

newXMLGregorianCalendarDate

Added in API level 8
XMLGregorianCalendar newXMLGregorianCalendarDate (int year, 
                int month, 
                int day, 
                int timezone)

创建XML模式内置数据类型 dateg*的Java表示 g*

例如,可以创建一个 gYear的实例,调用此工厂,其中 monthday参数设置为 FIELD_UNDEFINED

FIELD_UNDEFINED值表示该字段未设置。

Parameters
year int: of XMLGregorianCalendar to be created.
month int: of XMLGregorianCalendar to be created.
day int: of XMLGregorianCalendar to be created.
timezone int: offset in minutes. FIELD_UNDEFINED indicates optional field is not set.
Returns
XMLGregorianCalendar XMLGregorianCalendar created from parameter values.
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 XMLGregorianCalendar or if the composite values constitute an invalid XMLGregorianCalendar instance as determined by isValid().

也可以看看:

newXMLGregorianCalendarTime

Added in API level 8
XMLGregorianCalendar newXMLGregorianCalendarTime (int hours, 
                int minutes, 
                int seconds, 
                BigDecimal fractionalSecond, 
                int timezone)

创建XML模式内置数据类型时间的Java实例。

值为 null表示该字段未设置。

值为 FIELD_UNDEFINED表示该字段未设置。

Parameters
hours int: number of hours
minutes int: number of minutes
seconds int: number of seconds
fractionalSecond BigDecimal: value of null indicates that this optional field is not set.
timezone int: offset in minutes. FIELD_UNDEFINED indicates optional field is not set.
Returns
XMLGregorianCalendar XMLGregorianCalendar created from parameter values.
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 XMLGregorianCalendar or if the composite values constitute an invalid XMLGregorianCalendar instance as determined by isValid().

也可以看看:

newXMLGregorianCalendarTime

Added in API level 8
XMLGregorianCalendar newXMLGregorianCalendarTime (int hours, 
                int minutes, 
                int seconds, 
                int milliseconds, 
                int timezone)

创建XML模式内置数据类型时间的Java实例。

FIELD_UNDEFINED值表示该字段未设置。

Parameters
hours int: number of hours
minutes int: number of minutes
seconds int: number of seconds
milliseconds int: number of milliseconds
timezone int: offset in minutes. FIELD_UNDEFINED indicates optional field is not set.
Returns
XMLGregorianCalendar XMLGregorianCalendar created from parameter values.
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 XMLGregorianCalendar or if the composite values constitute an invalid XMLGregorianCalendar instance as determined by isValid().

也可以看看:

newXMLGregorianCalendarTime

Added in API level 8
XMLGregorianCalendar newXMLGregorianCalendarTime (int hours, 
                int minutes, 
                int seconds, 
                int timezone)

创建XML模式内置数据类型 time的Java实例。

值为 FIELD_UNDEFINED表示该字段未设置。

Parameters
hours int: number of hours
minutes int: number of minutes
seconds int: number of seconds
timezone int: offset in minutes. FIELD_UNDEFINED indicates optional field is not set.
Returns
XMLGregorianCalendar XMLGregorianCalendar created from parameter values.
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 XMLGregorianCalendar or if the composite values constitute an invalid XMLGregorianCalendar instance as determined by isValid().

也可以看看:

Hooray!