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
。 下列实施解决机制按以下顺序使用:
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
. 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. META-INF/services/java.xml.datatype.DatatypeFactory
. Any Exception thrown during the instantiation process is wrapped as a DatatypeConfigurationException
. Class
specified by DATATYPEFACTORY_IMPLEMENTATION_CLASS
, "javax.xml.datatype.DatatypeFactoryImpl
". Any Exception thrown during the instantiation process is wrapped as a DatatypeConfigurationException
. 请注意,您必须提供您自己的实现(例如Xerces); Android不附带默认实现。
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 |
newDuration(boolean isPositive, int years, int months, int days, int hours, int minutes, int seconds) 获得一个 |
abstract Duration |
newDuration(long durationInMilliSeconds) 获取 |
abstract Duration |
newDuration(String lexicalRepresentation) 获得的新实例 |
Duration |
newDurationDayTime(long durationInMilliseconds) 创建 |
Duration |
newDurationDayTime(boolean isPositive, BigInteger day, BigInteger hour, BigInteger minute, BigInteger second) 创建 |
Duration |
newDurationDayTime(boolean isPositive, int day, int hour, int minute, int second) 创建 |
Duration |
newDurationDayTime(String lexicalRepresentation) 创建 |
Duration |
newDurationYearMonth(String lexicalRepresentation) 创建 |
Duration |
newDurationYearMonth(boolean isPositive, BigInteger year, BigInteger month) 创建 |
Duration |
newDurationYearMonth(boolean isPositive, int year, int month) 创建 |
Duration |
newDurationYearMonth(long durationInMilliseconds) 创建 |
static DatatypeFactory |
newInstance(String factoryClassName, ClassLoader classLoader) 返回 |
static DatatypeFactory |
newInstance() 获取 |
abstract XMLGregorianCalendar |
newXMLGregorianCalendar(String lexicalRepresentation) 通过将字符串解析为词法表示来创建新的XMLGregorianCalendar。 |
abstract XMLGregorianCalendar |
newXMLGregorianCalendar(GregorianCalendar cal) 创建 |
XMLGregorianCalendar |
newXMLGregorianCalendar(int year, int month, int day, int hour, int minute, int second, int millisecond, int timezone)
|
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 |
newXMLGregorianCalendarDate(int year, int month, int day, int timezone) 创建XML模式内置数据类型 |
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模式内置数据类型 |
Inherited methods |
|
---|---|
From class java.lang.Object
|
String DATATYPEFACTORY_PROPERTY
JSR 206中定义的默认属性名称:用于XML处理的Java(TM)API(JAXP)1.3。
默认值是 javax.xml.datatype.DatatypeFactory
。
常量值:“javax.xml.datatype.DatatypeFactory”
String DATATYPEFACTORY_IMPLEMENTATION_CLASS
JSR 206中定义的默认实现类名称:用于XML处理的Java(TM)API(JAXP)1.3。
默认值是 org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl
。
DatatypeFactory ()
受保护的构造函数可防止包之外的实例化。
使用 newInstance()
创建 DatatypeFactory
。
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. |
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 . |
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.
所有六个值都是通过从指定的毫秒计算它们的值来设置的,并且可以使用创建的Duration
的get
方法来Duration
。 这些值符合并由以下定义:
XMLGregorianCalendar
Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation默认启动实例由下式定义 GregorianCalendar
的使用历元的开始的:即 YEAR
= 1970, MONTH
= JANUARY
, DATE
= 1等由于有在格里历的变化这一点很重要,例如,闰年有该月中的不同日期= FEBRUARY
因此可以影响 getMonths()
和 getDays()
的结果。
Parameters | |
---|---|
durationInMilliSeconds |
long : Duration in milliseconds to create. |
Returns | |
---|---|
Duration |
New Duration representing durationInMilliSeconds . |
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 . |
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
。
所有四个值都是通过从指定的毫秒计算它们的值来设置的,并且可以使用创建的Duration
的get
方法来Duration
。 这些值符合并由以下定义:
XMLGregorianCalendar
Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation默认启动实例由下式定义 GregorianCalendar
的使用历元的开始的:即 YEAR
= 1970, MONTH
= JANUARY
, DATE
= 1等由于有在格里历的变化这一点很重要,例如,闰年有当月不同天= FEBRUARY
这样的结果 getDays()
会受到影响。
在确定日,小时,分钟和秒之后的任何剩余的毫秒将被丢弃。
Parameters | |
---|---|
durationInMilliseconds |
long : Milliseconds of Duration to create. |
Returns | |
---|---|
Duration |
New Duration created with the specified durationInMilliseconds . |
Duration newDurationDayTime (boolean isPositive, BigInteger day, BigInteger hour, BigInteger minute, BigInteger second)
创建 Duration
类型的 xdt:dayTimeDuration
使用指定 day
, hour
, minute
和 second
中定义 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. |
Duration newDurationDayTime (boolean isPositive, int day, int hour, int minute, int second)
创建 Duration
类型的 xdt:dayTimeDuration
使用指定 day
, hour
, minute
和 second
中定义 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 . |
Duration newDurationDayTime (String lexicalRepresentation)
创建 Duration
型 xdt: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 . |
Duration newDurationYearMonth (String lexicalRepresentation)
创建 Duration
型 xdt: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 . |
Duration newDurationYearMonth (boolean isPositive, BigInteger year, BigInteger month)
创建 Duration
类型的 xdt:yearMonthDuration
使用指定 year
和 month
中定义 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. |
Duration newDurationYearMonth (boolean isPositive, int year, int month)
创建 Duration
类型的 xdt:yearMonthDuration
使用指定 year
和 month
中定义 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 . |
Duration newDurationYearMonth (long durationInMilliseconds)
使用 Duration
中定义的指定毫秒创建类型 xdt:yearMonthDuration
的 Duration 。
数据类型xdt:yearMonthDuration
是一个亚型xs:duration
,其词汇表示仅包含年份和月份组成部分。 此数据类型位于命名空间W3C_XPATH_DATATYPE_NS_URI
。
这两个值都是通过从指定的毫秒计算它们的值来设置的,并且可以使用创建的Duration
的get
方法来Duration
。 这些值符合并由以下定义:
XMLGregorianCalendar
Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation默认启动实例由下式定义 GregorianCalendar
的使用历元的开始的:即 YEAR
= 1970, MONTH
= JANUARY
, DATE
= 1等由于有在格里历的变化这一点很重要,例如,闰年有当月不同天= FEBRUARY
这样的结果 getMonths()
会受到影响。
放弃确定年份和月份后剩余的毫秒数。
Parameters | |
---|---|
durationInMilliseconds |
long : Milliseconds of Duration to create. |
Returns | |
---|---|
Duration |
New Duration created using the specified durationInMilliseconds . |
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. |
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. |
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 . |
XMLGregorianCalendar newXMLGregorianCalendar (GregorianCalendar cal)
创建 XMLGregorianCalendar
从 GregorianCalendar
。
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
字段,
this.getTimezone() != FIELD_UNDEFINED
, create a java.util.TimeZone
with a custom timezone id using the this.getTimezone()
.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 . |
XMLGregorianCalendar newXMLGregorianCalendar (int year, int month, int day, int hour, int minute, int second, int millisecond, int timezone)
java.util.GregorianCalendar
实例需要转换为 XMLGregorianCalendar
实例的值空间的构造函数。
XMLGregorianCalendar eon
和 fractionalSecond
设置为 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() . |
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() . |
XMLGregorianCalendar newXMLGregorianCalendar ()
创建一个 XMLGregorianCalendar
的新实例。
所有日期/时间数据类型字段设置为 FIELD_UNDEFINED
或为空。
Returns | |
---|---|
XMLGregorianCalendar |
New XMLGregorianCalendar with all date/time datatype fields set to FIELD_UNDEFINED or null. |
XMLGregorianCalendar newXMLGregorianCalendarDate (int year, int month, int day, int timezone)
创建XML模式内置数据类型 date
或 g*
的Java表示 g*
。
例如,可以创建一个 gYear
的实例,调用此工厂,其中 month
和 day
参数设置为 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() . |
也可以看看:
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() . |
也可以看看:
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() . |
也可以看看:
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() . |
也可以看看: