Package org.mycore.datamodel.common
Class MCRISO8601FormatChooser
java.lang.Object
org.mycore.datamodel.common.MCRISO8601FormatChooser
is a helper class for MCRMetaISO8601Date. Please be aware that this class is not supported. It may disappear some day
or methods get removed.
- Since:
- 1.3
- Version:
- $Revision: 18729 $ $Date: 2010-09-21 12:33:45 +0200 (Di, 21. Sep 2010) $
- Author:
- Thomas Scheffler (yagee)
-
Field Summary
Modifier and TypeFieldDescriptionstatic final DateTimeFormatter
static final DateTimeFormatter
static final DateTimeFormatter
static final DateTimeFormatter
static final DateTimeFormatter
static final DateTimeFormatter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
cropSecondFractions
(String isoString) returns a String that has not more than 3 digits representing "fractions of a second".static DateTimeFormatter
getFormatter
(String isoString, MCRISO8601Format isoFormat) returns a DateTimeFormatter for the given isoString or format.
-
Field Details
-
YEAR_FORMAT
-
YEAR_MONTH_FORMAT
-
COMPLETE_FORMAT
-
COMPLETE_HH_MM_FORMAT
-
COMPLETE_HH_MM_SS_FORMAT
-
COMPLETE_HH_MM_SS_SSS_FORMAT
-
-
Constructor Details
-
MCRISO8601FormatChooser
public MCRISO8601FormatChooser()
-
-
Method Details
-
getFormatter
returns a DateTimeFormatter for the given isoString or format. This method prefers the format parameter. So if it's not null or not zero length this method will interpret the format string. You can also get a formatter for e specific iso String. In either case if the underlying algorithm can not determine an exact matching formatter it will allway fall back to a default. So this method will never return null.- Parameters:
isoString
- an ISO 8601 formatted time String, or nullisoFormat
- a valid format String, or null- Returns:
- returns a specific DateTimeFormatter
-
cropSecondFractions
returns a String that has not more than 3 digits representing "fractions of a second". If isoString has no or not more than 3 digits this method simply returns isoString.- Parameters:
isoString
- an ISO 8601 formatted time String- Returns:
- an ISO 8601 formatted time String with at max 3 digits for fractions of a second
-