Package org.odftoolkit.odfdom.type
Class DateOrDateTime
java.lang.Object
org.odftoolkit.odfdom.type.DateOrDateTime
- All Implemented Interfaces:
OdfDataType
This class represents the in OpenDocument format used data type dateOrDateTime
-
Constructor Summary
ConstructorDescriptionDateOrDateTime
(XMLGregorianCalendar dateOrDateTime) Construct an newly DateOrDateTime object that represents the specified XMLGregorianCalendar value -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of this DateOrDateTime object as an XMLGregorianCalendarstatic boolean
isValid
(XMLGregorianCalendar dateOrDateTime) check if the specified XMLGregorianCalendar instance is a valid dateOrDateTime data typetoString()
Returns a String Object representing this DateOrDateTime valuestatic DateOrDateTime
Returns a DateOrDateTime instance representing the specified String value
-
Constructor Details
-
DateOrDateTime
Construct an newly DateOrDateTime object that represents the specified XMLGregorianCalendar value- Parameters:
dateOrDateTime
- the value to be represented by the DateOrDateTime Object- Throws:
IllegalArgumentException
- if the given argument is not a valid DateOrDateTime
-
-
Method Details
-
toString
Returns a String Object representing this DateOrDateTime value -
valueOf
Returns a DateOrDateTime instance representing the specified String value- Parameters:
stringValue
- a String value- Returns:
- return a DateOrDateTime instance representing stringValue
- Throws:
IllegalArgumentException
- if the given argument is not a valid DateOrDateTime
-
getXMLGregorianCalendar
Returns the value of this DateOrDateTime object as an XMLGregorianCalendar- Returns:
- the XMLGregorianCalendar value of this DateOrDateTime object.
-
isValid
check if the specified XMLGregorianCalendar instance is a valid dateOrDateTime data type- Parameters:
dateOrDateTime
- the value to be tested- Returns:
- true if the value of argument is valid for dateOrDateTime data type false otherwise
-