org.odftoolkit.odfdom.type
Class Date

java.lang.Object
  extended by org.odftoolkit.odfdom.type.Date
All Implemented Interfaces:
OdfDataType, OdfFieldDataType

public class Date
extends java.lang.Object
implements OdfFieldDataType, OdfDataType

This class represents the in OpenDocument format used data type Details of the type can be found in the W3C XML Schema specification.


Constructor Summary
Date(javax.xml.datatype.XMLGregorianCalendar date)
          Construct an newly Date object that represents the specified XMLGregorianCalendar value
 
Method Summary
 javax.xml.datatype.XMLGregorianCalendar getXMLGregorianCalendar()
          Returns the value of this Date object as an XMLGregorianCalendar
static boolean isValid(javax.xml.datatype.XMLGregorianCalendar date)
          check if the specified XMLGregorianCalendar instance is a valid data type
 java.lang.String toString()
          Returns a String Object representing this Date value
static Date valueOf(java.lang.String stringValue)
          Returns a Date 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

Date

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

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

toString

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

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

valueOf

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

Parameters:
stringValue - a String value
Returns:
return a Date instance representing stringValue
Throws:
java.lang.IllegalArgumentException - If the stringValue is not a date

getXMLGregorianCalendar

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

Returns:
the XMLGregorianCalendar value of this Date object.

isValid

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

Parameters:
date - 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.