DatatypeFactory.NewXMLGregorianCalendar Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
NewXMLGregorianCalendar() |
Create a new instance of an |
NewXMLGregorianCalendar(GregorianCalendar) |
Create an |
NewXMLGregorianCalendar(String) |
Create a new XMLGregorianCalendar by parsing the String as a lexical representation. |
NewXMLGregorianCalendar(BigInteger, Int32, Int32, Int32, Int32, Int32, BigDecimal, Int32) |
Constructor allowing for complete value spaces allowed by W3C XML Schema 1. |
NewXMLGregorianCalendar(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32) |
Constructor of value spaces that a
|
NewXMLGregorianCalendar()
Create a new instance of an XMLGregorianCalendar
.
[Android.Runtime.Register("newXMLGregorianCalendar", "()Ljavax/xml/datatype/XMLGregorianCalendar;", "GetNewXMLGregorianCalendarHandler")]
public abstract Javax.Xml.Datatype.XMLGregorianCalendar? NewXMLGregorianCalendar ();
[<Android.Runtime.Register("newXMLGregorianCalendar", "()Ljavax/xml/datatype/XMLGregorianCalendar;", "GetNewXMLGregorianCalendarHandler")>]
abstract member NewXMLGregorianCalendar : unit -> Javax.Xml.Datatype.XMLGregorianCalendar
Returns
New XMLGregorianCalendar
with all date/time datatype fields set to
DatatypeConstants#FIELD_UNDEFINED
or null.
- Attributes
Remarks
Create a new instance of an XMLGregorianCalendar
.
All date/time datatype fields set to DatatypeConstants#FIELD_UNDEFINED
or null.
Java documentation for javax.xml.datatype.DatatypeFactory.newXMLGregorianCalendar()
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
NewXMLGregorianCalendar(GregorianCalendar)
Create an XMLGregorianCalendar
from a GregorianCalendar
.
[Android.Runtime.Register("newXMLGregorianCalendar", "(Ljava/util/GregorianCalendar;)Ljavax/xml/datatype/XMLGregorianCalendar;", "GetNewXMLGregorianCalendar_Ljava_util_GregorianCalendar_Handler")]
public abstract Javax.Xml.Datatype.XMLGregorianCalendar? NewXMLGregorianCalendar (Java.Util.GregorianCalendar? cal);
[<Android.Runtime.Register("newXMLGregorianCalendar", "(Ljava/util/GregorianCalendar;)Ljavax/xml/datatype/XMLGregorianCalendar;", "GetNewXMLGregorianCalendar_Ljava_util_GregorianCalendar_Handler")>]
abstract member NewXMLGregorianCalendar : Java.Util.GregorianCalendar -> Javax.Xml.Datatype.XMLGregorianCalendar
Parameters
java.util.GregorianCalendar
used to create XMLGregorianCalendar
Returns
XMLGregorianCalendar
created from java.util.GregorianCalendar
- Attributes
Exceptions
If cal
is null
.
Remarks
Create an XMLGregorianCalendar
from a GregorianCalendar
.
<table border="2" rules="all" cellpadding="2"> <thead> <tr> <th align="center" colspan="2"> Field by Field Conversion from GregorianCalendar
to an XMLGregorianCalendar
</th> </tr> <tr> <th>java.util.GregorianCalendar
field</th> <th>javax.xml.datatype.XMLGregorianCalendar
field</th> </tr> </thead> <tbody> <tr> <td>ERA == GregorianCalendar.BC ? -YEAR : YEAR
</td> <td>XMLGregorianCalendar#setYear(int year)
</td> </tr> <tr> <td>MONTH + 1
</td> <td>XMLGregorianCalendar#setMonth(int month)
</td> </tr> <tr> <td>DAY_OF_MONTH
</td> <td>XMLGregorianCalendar#setDay(int day)
</td> </tr> <tr> <td>HOUR_OF_DAY, MINUTE, SECOND, MILLISECOND
</td> <td>XMLGregorianCalendar#setTime(int hour, int minute, int second, BigDecimal fractional)
</td> </tr> <tr> <td> (ZONE_OFFSET + DST_OFFSET) / (60*1000)
<br/> <em>(in minutes)</em> </td> <td>XMLGregorianCalendar#setTimezone(int offset)
<sup><em>*</em></sup> </td> </tr> </tbody> </table>
<em>*</em>conversion loss of information. It is not possible to represent a java.util.GregorianCalendar
daylight savings timezone id in the XML Schema 1.0 date/time datatype representation.
To compute the return value's TimeZone
field, <ul> <li>when this.getTimezone() != FIELD_UNDEFINED
, create a java.util.TimeZone
with a custom timezone id using the this.getTimezone()
.</li> <li>else use the GregorianCalendar
default timezone value for the host is defined as specified by java.util.TimeZone.getDefault()
.</li>
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
NewXMLGregorianCalendar(String)
Create a new XMLGregorianCalendar by parsing the String as a lexical representation.
[Android.Runtime.Register("newXMLGregorianCalendar", "(Ljava/lang/String;)Ljavax/xml/datatype/XMLGregorianCalendar;", "GetNewXMLGregorianCalendar_Ljava_lang_String_Handler")]
public abstract Javax.Xml.Datatype.XMLGregorianCalendar? NewXMLGregorianCalendar (string? lexicalRepresentation);
[<Android.Runtime.Register("newXMLGregorianCalendar", "(Ljava/lang/String;)Ljavax/xml/datatype/XMLGregorianCalendar;", "GetNewXMLGregorianCalendar_Ljava_lang_String_Handler")>]
abstract member NewXMLGregorianCalendar : string -> Javax.Xml.Datatype.XMLGregorianCalendar
Parameters
- lexicalRepresentation
- String
Lexical representation of one the eight XML Schema date/time datatypes.
Returns
XMLGregorianCalendar
created from the lexicalRepresentation
.
- Attributes
Exceptions
If the lexicalRepresentation
is not a valid XMLGregorianCalendar
.
If lexicalRepresentation
is null
.
Remarks
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.
Java documentation for javax.xml.datatype.DatatypeFactory.newXMLGregorianCalendar(java.lang.String)
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
NewXMLGregorianCalendar(BigInteger, Int32, Int32, Int32, Int32, Int32, BigDecimal, Int32)
Constructor allowing for complete value spaces allowed by W3C XML Schema 1.
[Android.Runtime.Register("newXMLGregorianCalendar", "(Ljava/math/BigInteger;IIIIILjava/math/BigDecimal;I)Ljavax/xml/datatype/XMLGregorianCalendar;", "GetNewXMLGregorianCalendar_Ljava_math_BigInteger_IIIIILjava_math_BigDecimal_IHandler")]
public abstract Javax.Xml.Datatype.XMLGregorianCalendar? NewXMLGregorianCalendar (Java.Math.BigInteger? year, int month, int day, int hour, int minute, int second, Java.Math.BigDecimal? fractionalSecond, int timezone);
[<Android.Runtime.Register("newXMLGregorianCalendar", "(Ljava/math/BigInteger;IIIIILjava/math/BigDecimal;I)Ljavax/xml/datatype/XMLGregorianCalendar;", "GetNewXMLGregorianCalendar_Ljava_math_BigInteger_IIIIILjava_math_BigDecimal_IHandler")>]
abstract member NewXMLGregorianCalendar : Java.Math.BigInteger * int * int * int * int * int * Java.Math.BigDecimal * int -> Javax.Xml.Datatype.XMLGregorianCalendar
Parameters
- year
- BigInteger
of XMLGregorianCalendar
to be created.
- month
- Int32
of XMLGregorianCalendar
to be created.
- day
- Int32
of XMLGregorianCalendar
to be created.
- hour
- Int32
of XMLGregorianCalendar
to be created.
- minute
- Int32
of XMLGregorianCalendar
to be created.
- second
- Int32
of XMLGregorianCalendar
to be created.
- fractionalSecond
- BigDecimal
of XMLGregorianCalendar
to be created.
- timezone
- Int32
of XMLGregorianCalendar
to be created.
Returns
XMLGregorianCalendar
created from specified values.
- Attributes
Exceptions
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.
Remarks
Constructor allowing for complete value spaces allowed by W3C XML Schema 1.0 recommendation for xsd:dateTime and related builtin datatypes. Note that year
parameter supports arbitrarily large numbers and fractionalSecond has infinite precision.
A null
value indicates that field is not set.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
NewXMLGregorianCalendar(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)
Constructor of value spaces that a
java.util.GregorianCalendar
instance would need to convert to an
XMLGregorianCalendar
instance.
[Android.Runtime.Register("newXMLGregorianCalendar", "(IIIIIIII)Ljavax/xml/datatype/XMLGregorianCalendar;", "GetNewXMLGregorianCalendar_IIIIIIIIHandler")]
public virtual Javax.Xml.Datatype.XMLGregorianCalendar? NewXMLGregorianCalendar (int year, int month, int day, int hour, int minute, int second, int millisecond, int timezone);
[<Android.Runtime.Register("newXMLGregorianCalendar", "(IIIIIIII)Ljavax/xml/datatype/XMLGregorianCalendar;", "GetNewXMLGregorianCalendar_IIIIIIIIHandler")>]
abstract member NewXMLGregorianCalendar : int * int * int * int * int * int * int * int -> Javax.Xml.Datatype.XMLGregorianCalendar
override this.NewXMLGregorianCalendar : int * int * int * int * int * int * int * int -> Javax.Xml.Datatype.XMLGregorianCalendar
Parameters
- year
- Int32
of XMLGregorianCalendar
to be created.
- month
- Int32
of XMLGregorianCalendar
to be created.
- day
- Int32
of XMLGregorianCalendar
to be created.
- hour
- Int32
of XMLGregorianCalendar
to be created.
- minute
- Int32
of XMLGregorianCalendar
to be created.
- second
- Int32
of XMLGregorianCalendar
to be created.
- millisecond
- Int32
of XMLGregorianCalendar
to be created.
- timezone
- Int32
of XMLGregorianCalendar
to be created.
Returns
XMLGregorianCalendar
created from specified values.
- Attributes
Exceptions
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.
Remarks
Constructor of value spaces that a java.util.GregorianCalendar
instance would need to convert to an XMLGregorianCalendar
instance.
XMLGregorianCalendar eon
and fractionalSecond
are set to null
A DatatypeConstants#FIELD_UNDEFINED
value indicates that field is not set.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.