Package org.mycore.datamodel.common
Class MCRISO8601Date
java.lang.Object
org.mycore.datamodel.common.MCRISO8601Date
holds info about a specific point in time. This class is used for handling ISO 8601 like date and dateTime formatted
strings.
- Author:
- Thomas Scheffler (yagee)
-
Field Summary
-
Constructor Summary
ConstructorDescriptioncreates an empty instance. usesetDate(String)
to parse a date/time by this instance.MCRISO8601Date
(String isoString) same asMCRISO8601Date()
andsetDate(String)
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
formats the date to a String.formats the date to a String.final Date
getDate()
returns the Date representing this element.getDt()
final String
returns a ISO 8601 conform String using the current set format.static MCRISO8601Date
now()
final void
sets the date for this meta data objectvoid
sets the date for this meta data object.void
sets the input and output format. please use only the formats defined on the W3C Page, which are also exported as static fields by this class.void
setFormat
(MCRISO8601Format isoFormat) sets the input and output format. please use only the formats defined on the W3C Page, which are also exported as static fields by this class.
-
Field Details
-
PROPERTY_STRICT_PARSING
- See Also:
-
-
Constructor Details
-
MCRISO8601Date
public MCRISO8601Date()creates an empty instance. usesetDate(String)
to parse a date/time by this instance. -
MCRISO8601Date
same asMCRISO8601Date()
andsetDate(String)
.- Parameters:
isoString
- a date or dateTime string as defined on W3C Page
-
-
Method Details
-
now
-
format
formats the date to a String.- Parameters:
format
- as inMCRISO8601Format
locale
- used by format process- Returns:
- null if date is not set yet
-
format
formats the date to a String.- Parameters:
format
- as inMCRISO8601Format
locale
- used by format processtimeZone
- valid timeZone id, e.g. "Europe/Berlin", or null- Returns:
- null if date is not set yet
-
getDate
returns the Date representing this element.- Returns:
- a new Date instance of the time set in this element
-
getDt
- Returns:
- the dt
-
getIsoFormat
- Returns:
- the isoFormat
-
getISOString
returns a ISO 8601 conform String using the current set format.- Returns:
- date in ISO 8601 format, or null if date is unset.
-
setDate
sets the date for this meta data object.- Parameters:
dt
- Date object representing date String in Element
-
setDate
sets the date for this meta data object- Parameters:
isoString
- Date in any form that is a valid W3C dateTime
-
setFormat
sets the input and output format. please use only the formats defined on the W3C Page, which are also exported as static fields by this class. -
setFormat
sets the input and output format. please use only the formats defined on the W3C Page, which are also exported as static fields by this class.- Parameters:
format
- a format string that is valid conforming to xsd:duration schema type.
-
equals
-