Class StringFormatToMessageFormatConverter

java.lang.Object
org.nuiton.i18n.plugin.bundle.StringFormatToMessageFormatConverter
All Implemented Interfaces:
BundleFormatConverter

@Component(role=BundleFormatConverter.class, hint="toMessageFormat") public class StringFormatToMessageFormatConverter extends Object implements BundleFormatConverter
Implementation of BundleFormatConverter to convert Formatter syntax to a MessageFormat syntax. Created: 05/05/11
Since:
2.4
Author:
Florian Desbois, Tony Chemit - chemit@codelutin.com
  • Field Details

    • PATTERN

      protected static Pattern PATTERN
  • Constructor Details

    • StringFormatToMessageFormatConverter

      public StringFormatToMessageFormatConverter()
  • Method Details

    • convert

      public String convert(String value)
      Description copied from interface: BundleFormatConverter
      Convert format syntax to an other from value.
      Specified by:
      convert in interface BundleFormatConverter
      Parameters:
      value - message with some format placeholders to convert
      Returns:
      the message with other format syntax
    • escapeQuoteChar

      protected String escapeQuoteChar(String value)
      Escape ' char with '', needed by MessageFormat.
      Parameters:
      value - Message that contains '
      Returns:
      the message with ' escaped