Author: jkaputin
Date: Tue Jul  5 05:33:26 2005
New Revision: 209266

URL: http://svn.apache.org/viewcvs?rev=209266&view=rev
Log:
added a getFormattedMessage method to ErrorReporter to 

format non-parsing error messages that will typically

be thrown in exceptions, rather than reported by the

ErrorReporter.

Modified:
    incubator/woden/java/src/org/apache/woden/internal/ErrorReporter.java
    incubator/woden/java/src/org/apache/woden/internal/MessageFormatter.java

Modified: incubator/woden/java/src/org/apache/woden/internal/ErrorReporter.java
URL: 
http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/ErrorReporter.java?rev=209266&r1=209265&r2=209266&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/ErrorReporter.java 
(original)
+++ incubator/woden/java/src/org/apache/woden/internal/ErrorReporter.java Tue 
Jul  5 05:33:26 2005
@@ -320,4 +320,21 @@
         return fLocale;

     }

 

+    /**

+     * Returns a formatted message string for the specified message key and 
arguments.

+     * Used for formatting messages that will not be reported by the error 
reporter as

+     * parsing errors (via the reportError method). Typically these types of 
messages 

+     * will be for configuration or runtime errors that will be thrown as 
exceptions

+     * by the caller.

+     * 

+     * @param key a String representing the message key

+     * @param arugments an Object array of message parameters

+     * @return the formatted message string

+     */

+    public String getFormattedMessage(String key, Object[] arguments)

+    {

+        String message = fMessageFormatter.formatMessage(fLocale, key, 
arguments);

+        return message;

+    }

+

 }


Modified: 
incubator/woden/java/src/org/apache/woden/internal/MessageFormatter.java
URL: 
http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/MessageFormatter.java?rev=209266&r1=209265&r2=209266&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/MessageFormatter.java 
(original)
+++ incubator/woden/java/src/org/apache/woden/internal/MessageFormatter.java 
Tue Jul  5 05:33:26 2005
@@ -27,6 +27,8 @@
      * @param key the message key

      * @param args message parameter values

      * @return the formatted message text

+     * 

+     * TODO @throws IllegalArgumentException if the message key is not 
recognized.

      */

     public String formatMessage(Locale locale, String key, Object[] args) {

         




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to