Package org.odftoolkit.odfdom.type
Class Date
- java.lang.Object
-
- org.odftoolkit.odfdom.type.Date
-
- All Implemented Interfaces:
OdfDataType
,OdfFieldDataType
public class Date extends Object implements OdfFieldDataType, OdfDataType
This class represents the in OpenDocument format used data type date Details of the type can be found in the W3C XML Schema specification.
-
-
Constructor Summary
Constructors Constructor Description Date(XMLGregorianCalendar date)
Construct an newly Date object that represents the specified XMLGregorianCalendar value
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description XMLGregorianCalendar
getXMLGregorianCalendar()
Returns the value of this Date object as an XMLGregorianCalendarstatic boolean
isValid(XMLGregorianCalendar date)
check if the specified XMLGregorianCalendar instance is a valid date data typeString
toString()
Returns a String Object representing this Date valuestatic Date
valueOf(String stringValue)
Returns a Date instance representing the specified String value
-
-
-
Constructor Detail
-
Date
public Date(XMLGregorianCalendar date) throws IllegalArgumentException
Construct an newly Date object that represents the specified XMLGregorianCalendar value- Parameters:
date
- the value to be represented by the Date Object- Throws:
IllegalArgumentException
- if the given argument is not a valid Date
-
-
Method Detail
-
toString
public String toString()
Returns a String Object representing this Date value
-
valueOf
public static Date valueOf(String stringValue) throws IllegalArgumentException
Returns a Date instance representing the specified String value- Parameters:
stringValue
- a String value- Returns:
- return a Date instance representing stringValue
- Throws:
IllegalArgumentException
- If the stringValue is not a date
-
getXMLGregorianCalendar
public 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(XMLGregorianCalendar date)
check if the specified XMLGregorianCalendar instance is a valid date data type- Parameters:
date
- the value to be tested- Returns:
- true if the value of argument is valid for date data type false otherwise
-
-