Class AliasTemplateDateFormatFactory


public final class AliasTemplateDateFormatFactory extends TemplateDateFormatFactory
Creates an alias to another format, so that the format can be referred to with a simple name in the template, rather than as a concrete pattern or other kind of format string.
Since:
2.3.24
  • Constructor Details

    • AliasTemplateDateFormatFactory

      public AliasTemplateDateFormatFactory(String targetFormatString)
      Parameters:
      targetFormatString - The format string this format will be an alias to.
    • AliasTemplateDateFormatFactory

      public AliasTemplateDateFormatFactory(String defaultTargetFormatString, Map<Locale,​String> localizedTargetFormatStrings)
      Parameters:
      defaultTargetFormatString - The format string this format will be an alias to if there's no locale-specific format string for the requested locale in localizedTargetFormatStrings
      localizedTargetFormatStrings - Maps Locale-s to format strings. If the desired locale doesn't occur in the map, a less specific locale is tried, repeatedly until only the language part remains. For example, if locale is new Locale("en", "US", "Linux"), then these keys will be attempted untol a match is found, in this order: new Locale("en", "US", "Linux"), new Locale("en", "US"), new Locale("en"). If there's still no matching key, the value of the targetFormatString will be used.
  • Method Details