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) |
|
|---|---|
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(). |
也可以看看: