Package org.cip4.lib.xjdf.type
Class DateTime
java.lang.Object
javax.xml.bind.annotation.adapters.XmlAdapter<ValueType,BoundType>
Implementation of the XJDF DateTime data type.
-
Constructor Summary
ConstructorsConstructorDescriptionDateTime()Default constructor.DateTime(int year, int month, int day) Custom constructor.DateTime(int year, int month, int day, int hour, int minute) Custom constructor.DateTime(int year, int month, int day, int hour, int minute, int second) Custom constructor.Creates a XJDF DateTime instance by a String expression object.Creates a XJDF DateTime instance by a Date object. -
Method Summary
Methods inherited from class org.cip4.lib.xjdf.type.AbstractXJdfType
equals, hashCode
-
Constructor Details
-
DateTime
public DateTime()Default constructor. -
DateTime
public DateTime(int year, int month, int day) Custom constructor. Accepting values for initializing.- Parameters:
year- The value used to set the YEAR.month- The value used to set the MONTH in year. January is "0".day- The value used to set the DAY in month.
-
DateTime
public DateTime(int year, int month, int day, int hour, int minute) Custom constructor. Accepting values for initializing.- Parameters:
year- The value used to set the YEAR.month- The value used to set the MONTH in year. January is "0".day- The value used to set the DAY in month.hour- The value used to set the HOUR of day.minute- The value used to set the MINUTE in of.
-
DateTime
public DateTime(int year, int month, int day, int hour, int minute, int second) Custom constructor. Accepting values for initializing.- Parameters:
year- The value used to set the YEAR.month- The value used to set the MONTH in year. January is "0".day- The value used to set the DAY in month.hour- The value used to set the HOUR of day.minute- The value used to set the MINUTE.second- The value used to set the SECOND.
-
DateTime
Creates a XJDF DateTime instance by a String expression object.- Parameters:
dateTime- XJDF DateTime String expression. Should match the format yyyy-MM-dd'T'HH:mm:ss'Z'.- Throws:
ParseException- if the passed expression
-
DateTime
Creates a XJDF DateTime instance by a Date object.- Parameters:
date- Date object.
-
-
Method Details
-
getCalendar
Clones the underlying calendar and returns it.- Returns:
- the cloned calendar
-
marshal
-
unmarshal
-
toString
- Specified by:
toStringin classAbstractXJdfType<String,DateTime> - See Also:
-
toString
Formats this DateTime object using the passed time zone.- Parameters:
timeZone- The time zone to use.- Returns:
- String representation based for the passed time zone.
-