Class BMoneyStringTranslator

All Implemented Interfaces:
ValueTranslator<org.tentackle.common.BMoney,String>

@ValueTranslatorService(modelClass=org.tentackle.common.BMoney.class, viewClass=java.lang.String.class) public class BMoneyStringTranslator extends FractionNumberStringTranslator<org.tentackle.common.BMoney>
BMoney translator.
Author:
harald
  • Constructor Details

    • BMoneyStringTranslator

      public BMoneyStringTranslator(FxTextComponent component)
      Creates a translator.
      Parameters:
      component - the text component
  • Method Details

    • toViewFunction

      public Function<org.tentackle.common.BMoney,String> toViewFunction()
      Description copied from interface: ValueTranslator
      Function to translate a model value to a view value.
      Returns:
      the function
    • toModelFunction

      public Function<String,org.tentackle.common.BMoney> toModelFunction()
      Description copied from interface: ValueTranslator
      Function to translate a view value to a model value.
      Returns:
      the function
    • getDefaultPattern

      public String getDefaultPattern()
      Description copied from class: NumberStringTranslator
      Gets the default pattern according to the type.
      Specified by:
      getDefaultPattern in class NumberStringTranslator<org.tentackle.common.BMoney>
      Returns:
      the pattern
    • parse

      protected org.tentackle.common.BMoney parse(String str)
      Description copied from class: NumberStringTranslator
      Parses a string to a number.
      Overrides:
      parse in class NumberStringTranslator<org.tentackle.common.BMoney>
      Parameters:
      str - the string
      Returns:
      the number