Package org.odftoolkit.odfdom.type
Class DateOrDateTime
- java.lang.Object
-
- org.odftoolkit.odfdom.type.DateOrDateTime
-
- All Implemented Interfaces:
OdfDataType
public class DateOrDateTime extends Object implements OdfDataType
This class represents the in OpenDocument format used data type dateOrDateTime
-
-
Constructor Summary
Constructors Constructor Description DateOrDateTime(XMLGregorianCalendar dateOrDateTime)Construct an newly DateOrDateTime object that represents the specified XMLGregorianCalendar value
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description XMLGregorianCalendargetXMLGregorianCalendar()Returns the value of this DateOrDateTime object as an XMLGregorianCalendarstatic booleanisValid(XMLGregorianCalendar dateOrDateTime)check if the specified XMLGregorianCalendar instance is a valid dateOrDateTime data typeStringtoString()Returns a String Object representing this DateOrDateTime valuestatic DateOrDateTimevalueOf(String stringValue)Returns a DateOrDateTime instance representing the specified String value
-
-
-
Constructor Detail
-
DateOrDateTime
public DateOrDateTime(XMLGregorianCalendar dateOrDateTime) throws IllegalArgumentException
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 Detail
-
toString
public String toString()
Returns a String Object representing this DateOrDateTime value
-
valueOf
public static DateOrDateTime valueOf(String stringValue) throws IllegalArgumentException
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
public 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(XMLGregorianCalendar dateOrDateTime)
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
-
-