Class AliasTemplateNumberFormatFactory


  • public final class AliasTemplateNumberFormatFactory
    extends TemplateNumberFormatFactory
    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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      TemplateNumberFormat get​(java.lang.String params, java.util.Locale locale, Environment env)
      Returns a formatter for the given parameters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AliasTemplateNumberFormatFactory

        public AliasTemplateNumberFormatFactory​(java.lang.String targetFormatString)
        Parameters:
        targetFormatString - The format string this format will be an alias to
      • AliasTemplateNumberFormatFactory

        public AliasTemplateNumberFormatFactory​(java.lang.String defaultTargetFormatString,
                                                java.util.Map<java.util.Locale,​java.lang.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.