org.odftoolkit.odfdom.type
Class DateOrDateTime

java.lang.Object
  extended by org.odftoolkit.odfdom.type.DateOrDateTime
All Implemented Interfaces:
OdfDataType

public class DateOrDateTime
extends java.lang.Object
implements OdfDataType

This class represents the in OpenDocument format used data type


Constructor Summary
DateOrDateTime(javax.xml.datatype.XMLGregorianCalendar dateOrDateTime)
          Construct an newly DateOrDateTime object that represents the specified XMLGregorianCalendar value
 
Method Summary
 javax.xml.datatype.XMLGregorianCalendar getXMLGregorianCalendar()
          Returns the value of this DateOrDateTime object as an XMLGregorianCalendar
static boolean isValid(javax.xml.datatype.XMLGregorianCalendar dateOrDateTime)
          check if the specified XMLGregorianCalendar instance is a valid data type
 java.lang.String toString()
          Returns a String Object representing this DateOrDateTime value
static DateOrDateTime valueOf(java.lang.String stringValue)
          Returns a DateOrDateTime instance representing the specified String value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateOrDateTime

public DateOrDateTime(javax.xml.datatype.XMLGregorianCalendar dateOrDateTime)
               throws java.lang.IllegalArgumentException
Construct an newly DateOrDateTime object that represents the specified XMLGregorianCalendar value

Parameters:
dateOrDateTime - the value to be represented by the DateOrDateTime Object
Throws:
java.lang.IllegalArgumentException - if the given argument is not a valid DateOrDateTime
Method Detail

toString

public java.lang.String toString()
Returns a String Object representing this DateOrDateTime value

Overrides:
toString in class java.lang.Object
Returns:
return a string representation of the value of this DateOrDateTime object

valueOf

public static DateOrDateTime valueOf(java.lang.String stringValue)
                              throws java.lang.IllegalArgumentException
Returns a DateOrDateTime instance representing the specified String value

Parameters:
stringValue - a String value
Returns:
return a DateOrDateTime instance representing stringValue
Throws:
java.lang.IllegalArgumentException - if the given argument is not a valid DateOrDateTime

getXMLGregorianCalendar

public javax.xml.datatype.XMLGregorianCalendar getXMLGregorianCalendar()
Returns the value of this DateOrDateTime object as an XMLGregorianCalendar

Returns:
the XMLGregorianCalendar value of this DateOrDateTime object.

isValid

public static boolean isValid(javax.xml.datatype.XMLGregorianCalendar dateOrDateTime)
check if the specified XMLGregorianCalendar instance is a valid data type

Parameters:
dateOrDateTime - the value to be tested
Returns:
true if the value of argument is valid for data type false otherwise


Copyright © 2008-2010 ODF Toolkit Project. All Rights Reserved.