Module jonix.onix3

Class Date

java.lang.Object
com.tectonica.jonix.onix3.Date
All Implemented Interfaces:
OnixElement<String>, OnixTag, Serializable

public class Date extends Object implements OnixElement<String>, Serializable

Date

The date specified in the <EpubLicenseDateRole> field. Mandatory in each occurrence of the <EpubLicenseDate> composite, and non-repeating. <Date> may carry a dateformat attribute: if the attribute is missing, then the default format is YYYYMMDD.

Format As specified by the value in the dateformat attribute, or the default YYYYMMDD
Reference name <Date>
Short tag <b306>
Cardinality 1
Attributes dateformat
Example <Date>20221028</Date>
Notes Note that all dates are inclusive, so 'Valid from' is the first date on which the license is effective, and 'Valid until' is the last date on which it is effective.

This tag may be included in the following composites:

Possible placements within ONIX message:

Since:
Onix-3.10
See Also:
  • Field Details

    • refname

      public static final String refname
      See Also:
    • shortname

      public static final String shortname
      See Also:
    • datestamp

      public String datestamp
      (type: dt.DateOrDateTime)
    • sourcename

      public String sourcename
      (type: dt.NonEmptyString)
    • sourcetype

      public RecordSourceTypes sourcetype
    • dateformat

      public DateFormats dateformat
    • value

      public String value
      This is the raw content of Date. Could be null if exists() == false. Use OnixElement.value() instead if you want to get this as an Optional.

      Raw Format: As specified by the value in the dateformat attribute, or the default YYYYMMDD

      (type: dt.NonEmptyString)

    • EMPTY

      public static final Date EMPTY
  • Constructor Details

    • Date

      public Date()
    • Date

      public Date(Element element)
  • Method Details

    • __v

      public String __v()
      Internal API, use the OnixElement.value() method or the OnixElement.value() field instead
      Specified by:
      __v in interface OnixElement<String>
    • exists

      public boolean exists()
      Description copied from interface: OnixTag
      indicates whether this tag exists in the ONIX record
      Specified by:
      exists in interface OnixTag
      Returns:
      whether this tag (<Date> or <b306>) is explicitly provided in the ONIX XML
    • ifExists

      public void ifExists(Consumer<Date> action)