Class MCRISO8601FormatChooser

java.lang.Object
org.mycore.datamodel.common.MCRISO8601FormatChooser

public final class MCRISO8601FormatChooser extends Object
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 Details

  • Constructor Details

    • MCRISO8601FormatChooser

      public MCRISO8601FormatChooser()
  • Method Details

    • getFormatter

      public static DateTimeFormatter getFormatter(String isoString, MCRISO8601Format isoFormat)
      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 null
      isoFormat - a valid format String, or null
      Returns:
      returns a specific DateTimeFormatter
    • cropSecondFractions

      public static String cropSecondFractions(String isoString)
      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