Uploaded image for project: 'Commons Text'
  1. Commons Text
  2. TEXT-95

Convenience formatting method in ExtendedMethodFormat

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.1
    • 1.x
    • None

    Description

      It would be nice to have a simple formatting method in ExtendedMethodFormat:

      String format(Object... arguments)
      

      Intended use:

      ExtendedMessageFormat messageFormat = new ExtendedMessageFormat("{0}, {1}", Locale.ROOT);
      
      String output = messageFormat.format("Hello", "World");
      

      The current formatting method of (Extended)MethodFormat is quite inconvenient for simple use cases:

      ExtendedMessageFormat messageFormat = new ExtendedMessageFormat("{0}, {1}", Locale.ROOT);
      
      Object[] arguments = { "Hello", "World" };
      StringBuffer outputBuffer = messageFormat.format(arguments, new StringBuffer(), null);
      String output = outputBuffer.toString();
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            arendvr.com Arend v. Reinersdorff
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: