Class DateTime

java.lang.Object
javax.xml.bind.annotation.adapters.XmlAdapter<ValueType,BoundType>
org.cip4.lib.xjdf.type.AbstractXJdfType<String,DateTime>
org.cip4.lib.xjdf.type.DateTime

public class DateTime extends AbstractXJdfType<String,DateTime>
Implementation of the XJDF DateTime data type.
  • 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

      public DateTime(String dateTime) throws ParseException
      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

      public DateTime(Date date)
      Creates a XJDF DateTime instance by a Date object.
      Parameters:
      date - Date object.
  • Method Details

    • getCalendar

      public final Calendar getCalendar()
      Clones the underlying calendar and returns it.
      Returns:
      the cloned calendar
    • marshal

      public final String marshal(DateTime dateTime)
      Specified by:
      marshal in class javax.xml.bind.annotation.adapters.XmlAdapter<String,DateTime>
      See Also:
      • XmlAdapter.marshal(java.lang.Object)
    • unmarshal

      public final DateTime unmarshal(String dateTime) throws Exception
      Specified by:
      unmarshal in class javax.xml.bind.annotation.adapters.XmlAdapter<String,DateTime>
      Throws:
      Exception
      See Also:
      • XmlAdapter.unmarshal(java.lang.Object)
    • toString

      public final String toString()
      Specified by:
      toString in class AbstractXJdfType<String,DateTime>
      See Also:
    • toString

      public final String toString(TimeZone timeZone)
      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.