Class FormatInternalizeTokenProvider

java.lang.Object
com.e1c.langtool.v8.dt.format.FormatInternalizeTokenProvider

public class FormatInternalizeTokenProvider extends Object
Translates internal format string enums
  • Field Details

    • NUMERAL_TYPE

      public static final String NUMERAL_TYPE
      The Constant NUMERAL_TYPE.
      See Also:
    • BOOLEAN_FRACTION

      public static final String BOOLEAN_FRACTION
      The Constant BOOLEAN_FRACTION.
      See Also:
    • BOOLEAN_FRACTION_RU

      public static final String BOOLEAN_FRACTION_RU
      The Constant BOOLEAN_FRACTION_RU.
      See Also:
    • enumTokens

      protected com.google.common.collect.BiMap<String,String> enumTokens
      The enum tokens.
    • dateFormatTokens

      protected com.google.common.collect.BiMap<String,String> dateFormatTokens
      The date format tokens.
    • dateFormatSymbols

      protected com.google.common.collect.BiMap<String,String> dateFormatSymbols
      The date format symbols.
    • localDateFormatTokens

      protected com.google.common.collect.BiMap<String,String> localDateFormatTokens
      The local date format tokens.
    • numberInWordsType

      protected com.google.common.collect.BiMap<String,String> numberInWordsType
      The number in words type.
    • cases

      protected com.google.common.collect.BiMap<String,String> cases
      The cases.
    • gender

      protected com.google.common.collect.BiMap<String,String> gender
      The gender.
    • numberPresentation

      protected com.google.common.collect.BiMap<String,String> numberPresentation
      The number presentation.
    • numeralType

      protected com.google.common.collect.BiMap<String,String> numeralType
      The numeral type.
  • Constructor Details

    • FormatInternalizeTokenProvider

      public FormatInternalizeTokenProvider()
  • Method Details

    • getInternalizeEnumValue

      public String getInternalizeEnumValue(String enumValue, boolean isRussian)
      Gets the internalize enum value.
      Parameters:
      enumValue - the enum value. Cannot be null
      isRussian - the is russian
      Returns:
      the internalize enum value. Can be null
    • getInternalizeEnumValue

      public String getInternalizeEnumValue(String enumValue, ScriptVariant scriptVariant)
      Gets the internalize enum value.
      Parameters:
      enumValue - the enum value. Cannot be null
      scriptVariant - the script variant. Cannot be null
      Returns:
      the internalize enum value. Can be null
    • getInternalizeDateFormatValue

      public String getInternalizeDateFormatValue(String enumValue, boolean isRussian)
      Gets the internalize date format value.
      Parameters:
      enumValue - the enum value. Cannot be null
      isRussian - the is russian
      Returns:
      the internalize date format value. Can be null
    • getInternalizeDateFormatValue

      public String getInternalizeDateFormatValue(String enumValue, ScriptVariant scriptVariant)
      Gets the internalize date format value.
      Parameters:
      enumValue - the enum value. Cannot be null
      scriptVariant - the script variant. Cannot be null
      Returns:
      the internalize date format value. Can be null
    • getInternalizeDateFormatSybmol

      public String getInternalizeDateFormatSybmol(String symbol, ScriptVariant scriptVariant)
      Gets the internalize date format sybmol.
      Parameters:
      symbol - the symbol. Cannot be null
      scriptVariant - the script variant. Cannot be null
      Returns:
      the internalize date format sybmol. Can be null
    • getInternalizeLocalDateFormatValue

      public String getInternalizeLocalDateFormatValue(String enumValue, boolean isRussian)
      Gets the internalize local date format value.
      Parameters:
      enumValue - the enum value. Cannot be null
      isRussian - the is russian
      Returns:
      the internalize local date format value. Can be null
    • getInternalizeLocalDateFormatValue

      public String getInternalizeLocalDateFormatValue(String enumValue, ScriptVariant scriptVariant)
      Gets the internalize local date format value.
      Parameters:
      enumValue - the enum value. Cannot be null
      scriptVariant - the script variant. Cannot be null
      Returns:
      the internalize local date format value. Can be null
    • getCase

      public String getCase(String enumValue, ScriptVariant scriptVariant)
      Gets the case.
      Parameters:
      enumValue - the enum value. Cannot be null
      scriptVariant - the script variant. Cannot be null
      Returns:
      the case. Can be null
    • getGender

      public String getGender(String enumValue, ScriptVariant scriptVariant)
      Gets the gender.
      Parameters:
      enumValue - the enum value. Cannot be null
      scriptVariant - the script variant. Cannot be null
      Returns:
      the gender. Can be null
    • getNumberInWordsType

      public String getNumberInWordsType(String enumValue, ScriptVariant scriptVariant)
      Gets the number in words type.
      Parameters:
      enumValue - the enum value. Cannot be null
      scriptVariant - the script variant. Cannot be null
      Returns:
      the number in words type. Can be null
    • getNumberPresentation

      public String getNumberPresentation(String enumValue, ScriptVariant scriptVariant)
      Gets the number presentation.
      Parameters:
      enumValue - the enum value. Cannot be null
      scriptVariant - the script variant. Cannot be null
      Returns:
      the number presentation. Can be null
    • getNumeralType

      public String getNumeralType(String enumValue, ScriptVariant scriptVariant)
      Gets the numeral type.
      Parameters:
      enumValue - the enum value. Cannot be null
      scriptVariant - the script variant. Cannot be null
      Returns:
      the numeral type. Can be null
    • getBooleanType

      public String getBooleanType(String key, ScriptVariant scriptVariant)
      Gets boolean type from booleanType collection.
      Parameters:
      key - of enum value. Cannot be null
      scriptVariant - the script variant. Cannot be null
      Returns:
      the boolean type present in lower case. Can be null
    • isDataFormat

      public boolean isDataFormat(String enumValue)
      Checks if is data format.
      Parameters:
      enumValue - the enum value. Cannot be null
      Returns:
      true, if is data format
    • isLocalDataFormat

      public boolean isLocalDataFormat(String enumValue)
      Checks if is local data format.
      Parameters:
      enumValue - the enum value. Cannot be null
      Returns:
      true, if is local data format
    • isCase

      public boolean isCase(String enumValue)
      Checks if is case.
      Parameters:
      enumValue - the enum value. Cannot be null
      Returns:
      true, if is case
    • isGender

      public boolean isGender(String enumValue)
      Checks if is gender.
      Parameters:
      enumValue - the enum value. Cannot be null
      Returns:
      true, if is gender
    • isNumberInWordsType

      public boolean isNumberInWordsType(String enumValue)
      Checks if is number in words type.
      Parameters:
      enumValue - the enum value. Cannot be null
      Returns:
      true, if is number in words type
    • isNumberPresentation

      public boolean isNumberPresentation(String enumValue)
      Checks if is number presentation.
      Parameters:
      enumValue - the enum value. Cannot be null
      Returns:
      true, if is number presentation
    • isNumeralType

      public boolean isNumeralType(String enumValue)
      Checks if is numeral type.
      Parameters:
      enumValue - the enum value. Cannot be null
      Returns:
      true, if is numeral type
    • isBooleanType

      public boolean isBooleanType(String key)
      Checks if is boolean type.
      Parameters:
      enum - key, can be null
      Returns:
      true if is boolean type
    • isEnumType

      public boolean isEnumType(String enumValue)
      Checks if is enum type.
      Parameters:
      enumValue - the enum value, can be null
      Returns:
      true, if is enum type
    • init

      protected void init()
      Inits internal maps
    • initEnumTokens

      protected void initEnumTokens()
      Inits the enum tokens.
    • isFormatKey

      public boolean isFormatKey(String key)
      Checks if is format key.
      Parameters:
      key - the key, can be null
      Returns:
      true, if is format key
    • initDateFormatTokens

      protected void initDateFormatTokens()
      Inits the date format tokens.
    • initDateFormatSymbols

      protected void initDateFormatSymbols()
      Inits the date format symbols.
    • initNumeralType

      protected void initNumeralType()
      Inits the numeral type.
    • initCases

      protected void initCases()
      Inits the cases.
    • initNumberPresentation

      protected void initNumberPresentation()
      Inits the number presentation.
    • initGender

      protected void initGender()
      Inits the gender.
    • initNumberInWordsType

      protected void initNumberInWordsType()
      Inits the number in words type.
    • initLocalDateFormatTokens

      protected void initLocalDateFormatTokens()
      Inits the local date format tokens.