XMLGregorianCalendar Class

Definition

Representation for W3C XML Schema 1.

[Android.Runtime.Register("javax/xml/datatype/XMLGregorianCalendar", DoNotGenerateAcw=true)]
public abstract class XMLGregorianCalendar : Java.Lang.Object, IDisposable, Java.Interop.IJavaPeerable, Java.Lang.ICloneable
[<Android.Runtime.Register("javax/xml/datatype/XMLGregorianCalendar", DoNotGenerateAcw=true)>]
type XMLGregorianCalendar = class
    inherit Object
    interface ICloneable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
XMLGregorianCalendar
Attributes
Implements

Remarks

Representation for W3C XML Schema 1.0 date/time datatypes. Specifically, these date/time datatypes are <c>dateTime</c>, <c>time</c>, <c>date</c>, <c>gYearMonth</c>, <c>gMonthDay</c>, <c>gYear</c><c>gMonth</c> and <c>gDay</c> defined in the XML Namespace "http://www.w3.org/2001/XMLSchema". These datatypes are normatively defined in W3C XML Schema 1.0 Part 2, Section 3.2.7-14.

The table below defines the mapping between XML Schema 1.0 date/time datatype fields and this class' fields. It also summarizes the value constraints for the date and time fields defined in W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats.

"datetimefieldsmapping"/> <table border="2" rules="all" cellpadding="2"> <thead> <tr> <th align="center" colspan="3"> Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation </th> </tr> </thead> <tbody> <tr> <th>XML Schema 1.0<br/> datatype<br/> field</th> <th>Related<br/>XMLGregorianCalendar<br/>Accessor(s)</th> <th>Value Range</th> </tr> "datetimefield-year"/&gt; &lt;tr&gt; &lt;td&gt; year &lt;/td&gt; &lt;td&gt; &lt;c&gt;#getYear()&lt;/c&gt; + &lt;c&gt;#getEon()&lt;/c&gt; or&lt;br/&gt; &lt;c&gt;#getEonAndYear&lt;/c&gt;&lt;/td&gt; &lt;td&gt; &lt;c&gt;getYear()&lt;/c&gt; is a value between -(10^9-1) to (10^9)-1 or &lt;c&gt;DatatypeConstants#FIELD_UNDEFINED&lt;/c&gt;.&lt;br/&gt; &lt;c&gt;#getEon()&lt;/c&gt; is high order year value in billion of years.&lt;br/&gt; &lt;c&gt;getEon()&lt;/c&gt; has values greater than or equal to (10^9) or less than or equal to -(10^9). A value of null indicates field is undefined.&lt;/br&gt; Given that &lt;see href="http://www.w3.org/2001/05/xmlschema-errata#e2-63"&gt;XML Schema 1.0 errata&lt;/see&gt; states that the year zero will be a valid lexical value in a future version of XML Schema, this class allows the year field to be set to zero. Otherwise, the year field value is handled exactly as described in the errata and [ISO-8601-1988]. Note that W3C XML Schema 1.0 validation does not allow for the year field to have a value of zero. &lt;/td&gt; &lt;/tr&gt; "datetimefield-month"/&amp;gt; &amp;lt;tr&amp;gt; &amp;lt;td&amp;gt; month &amp;lt;/td&amp;gt; &amp;lt;td&amp;gt; &amp;lt;c&amp;gt;#getMonth()&amp;lt;/c&amp;gt;&amp;lt;/td&amp;gt; &amp;lt;td&amp;gt; 1 to 12 or &amp;lt;c&amp;gt;DatatypeConstants#FIELD_UNDEFINED&amp;lt;/c&amp;gt;&amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt; "datetimefield-day"/&amp;amp;gt; &amp;amp;lt;tr&amp;amp;gt; &amp;amp;lt;td&amp;amp;gt; day &amp;amp;lt;/td&amp;amp;gt; &amp;amp;lt;td&amp;amp;gt; &amp;amp;lt;c&amp;amp;gt;#getDay()&amp;amp;lt;/c&amp;amp;gt;&amp;amp;lt;/td&amp;amp;gt; &amp;amp;lt;td&amp;amp;gt; Independent of month, max range is 1 to 31 or &amp;amp;lt;c&amp;amp;gt;DatatypeConstants#FIELD_UNDEFINED&amp;amp;lt;/c&amp;amp;gt;.&amp;amp;lt;br/&amp;amp;gt; The normative value constraint stated relative to month field's value is in &amp;amp;lt;see href="http://www.w3.org/TR/xmlschema-2/#isoformats"&amp;amp;gt;W3C XML Schema 1.0 Part 2, Appendix D&amp;amp;lt;/see&amp;amp;gt;. &amp;amp;lt;/td&amp;amp;gt; &amp;amp;lt;/tr&amp;amp;gt; &amp;amp;lt;tr id="datetimefield-hour"&amp;amp;gt; &amp;amp;lt;td&amp;amp;gt;hour&amp;amp;lt;/td&amp;amp;gt; &amp;amp;lt;td&amp;amp;gt;&amp;amp;lt;c&amp;amp;gt;#getHour()&amp;amp;lt;/c&amp;amp;gt;&amp;amp;lt;/td&amp;amp;gt; &amp;amp;lt;td&amp;amp;gt; 0 to 24 or &amp;amp;lt;c&amp;amp;gt;DatatypeConstants#FIELD_UNDEFINED&amp;amp;lt;/c&amp;amp;gt;. For a value of 24, the minute and second field must be zero per &amp;amp;lt;see href="http://www.w3.org/2001/05/xmlschema-errata#e2-45"&amp;amp;gt;XML Schema Errata&amp;amp;lt;/see&amp;amp;gt;. &amp;amp;lt;/td&amp;amp;gt; &amp;amp;lt;/tr&amp;amp;gt; "datetimefield-minute"/&amp;amp;amp;gt; &amp;amp;amp;lt;tr&amp;amp;amp;gt; &amp;amp;amp;lt;td&amp;amp;amp;gt; minute &amp;amp;amp;lt;/td&amp;amp;amp;gt; &amp;amp;amp;lt;td&amp;amp;amp;gt; &amp;amp;amp;lt;c&amp;amp;amp;gt;#getMinute()&amp;amp;amp;lt;/c&amp;amp;amp;gt;&amp;amp;amp;lt;/td&amp;amp;amp;gt; &amp;amp;amp;lt;td&amp;amp;amp;gt; 0 to 59 or &amp;amp;amp;lt;c&amp;amp;amp;gt;DatatypeConstants#FIELD_UNDEFINED&amp;amp;amp;lt;/c&amp;amp;amp;gt;&amp;amp;amp;lt;/td&amp;amp;amp;gt; &amp;amp;amp;lt;/tr&amp;amp;amp;gt; "datetimefield-second"/&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;tr&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;td&amp;amp;amp;amp;gt;second&amp;amp;amp;amp;lt;/td&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;td&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;c&amp;amp;amp;amp;gt;#getSecond()&amp;amp;amp;amp;lt;/c&amp;amp;amp;amp;gt; + &amp;amp;amp;amp;lt;c&amp;amp;amp;amp;gt;#getMillisecond()&amp;amp;amp;amp;lt;/c&amp;amp;amp;amp;gt;/1000 or&amp;amp;amp;amp;lt;br/&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;c&amp;amp;amp;amp;gt;#getSecond()&amp;amp;amp;amp;lt;/c&amp;amp;amp;amp;gt; + &amp;amp;amp;amp;lt;c&amp;amp;amp;amp;gt;#getFractionalSecond()&amp;amp;amp;amp;lt;/c&amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;/td&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;td&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;c&amp;amp;amp;amp;gt;#getSecond()&amp;amp;amp;amp;lt;/c&amp;amp;amp;amp;gt; from 0 to 60 or &amp;amp;amp;amp;lt;c&amp;amp;amp;amp;gt;DatatypeConstants#FIELD_UNDEFINED&amp;amp;amp;amp;lt;/c&amp;amp;amp;amp;gt;.&amp;amp;amp;amp;lt;br/&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;i&amp;amp;amp;amp;gt;(Note: 60 only allowable for leap second.)&amp;amp;amp;amp;lt;/i&amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br/&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;c&amp;amp;amp;amp;gt;#getFractionalSecond()&amp;amp;amp;amp;lt;/c&amp;amp;amp;amp;gt; allows for infinite precision over the range from 0.0 to 1.0 when the &amp;amp;amp;amp;lt;c&amp;amp;amp;amp;gt;#getSecond()&amp;amp;amp;amp;lt;/c&amp;amp;amp;amp;gt; is defined.&amp;amp;amp;amp;lt;br/&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;c&amp;amp;amp;amp;gt;FractionalSecond&amp;amp;amp;amp;lt;/c&amp;amp;amp;amp;gt; is optional and has a value of &amp;amp;amp;amp;lt;c&amp;amp;amp;amp;gt;null&amp;amp;amp;amp;lt;/c&amp;amp;amp;amp;gt; when it is undefined.&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;c&amp;amp;amp;amp;gt;#getMillisecond()&amp;amp;amp;amp;lt;/c&amp;amp;amp;amp;gt; is the convenience millisecond precision of value of &amp;amp;amp;amp;lt;c&amp;amp;amp;amp;gt;#getFractionalSecond()&amp;amp;amp;amp;lt;/c&amp;amp;amp;amp;gt;. &amp;amp;amp;amp;lt;/td&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;/tr&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;tr id="datetimefield-timezone"&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;td&amp;amp;amp;amp;gt; timezone &amp;amp;amp;amp;lt;/td&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;td&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;c&amp;amp;amp;amp;gt;#getTimezone()&amp;amp;amp;amp;lt;/c&amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;/td&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;td&amp;amp;amp;amp;gt; Number of minutes or &amp;amp;amp;amp;lt;c&amp;amp;amp;amp;gt;DatatypeConstants#FIELD_UNDEFINED&amp;amp;amp;amp;lt;/c&amp;amp;amp;amp;gt;. Value range from -14 hours (-14 * 60 minutes) to 14 hours (14 * 60 minutes). &amp;amp;amp;amp;lt;/td&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;/tr&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;/tbody&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;/table&amp;amp;amp;amp;gt;

All maximum value space constraints listed for the fields in the table above are checked by factory methods,

Added in 1.5.

Java documentation for javax.xml.datatype.XMLGregorianCalendar.

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.

Constructors

XMLGregorianCalendar()
XMLGregorianCalendar(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Day
Eon
EonAndYear
FractionalSecond
Handle

The handle to the underlying Android instance.

(Inherited from Object)
Hour

Return hours or FieldUndefined.

IsValid

Validate instance by getXMLSchemaType() constraints.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
Millisecond

Return millisecond precision of #getFractionalSecond().

Minute

Returns FieldUndefined if this field is not defined.

Month
PeerReference (Inherited from Object)
Second
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Timezone

Return timezone offset in minutes or FieldUndefined if this optional field is not defined.

XMLSchemaType
Year

Methods

Add(Duration)

Add duration to this instance.

Clear()

Unset all fields to undefined.

Clone()

Creates and returns a copy of this object.

Compare(XMLGregorianCalendar)

Compare two instances of W3C XML Schema 1.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetTimeZone(Int32)

Returns a java.util.TimeZone for this class.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Normalize()

Normalize this instance to UTC.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
Reset()

Reset this XMLGregorianCalendar to its original values.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetMillisecond(Int32)

Set milliseconds.

SetTime(Int32, Int32, Int32)

Set time as one unit.

SetTime(Int32, Int32, Int32, BigDecimal)

Set time as one unit, including the optional infinite precision fractional seconds.

SetTime(Int32, Int32, Int32, Int32)

Set time as one unit, including optional milliseconds.

SetYear(BigInteger)

Set low and high order component of XSD dateTime year field.

ToArray<T>() (Inherited from Object)
ToGregorianCalendar()

Convert this XMLGregorianCalendar to a GregorianCalendar.

ToGregorianCalendar(TimeZone, Locale, XMLGregorianCalendar)

Convert this XMLGregorianCalendar along with provided parameters to a GregorianCalendar instance.

ToString()

Returns a string representation of the object.

(Inherited from Object)
ToXMLFormat()

Return the lexical representation of this instance.

UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to