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