Coverage report

  %line %branch
org.demosys.web.util.MessageUtil
0% 
0% 

 1  
 /*
 2  
  * Demosys.
 3  
  *
 4  
  * Terms of license - http://opensource.org/licenses/apachepl.php
 5  
  */
 6  
 package org.demosys.web.util;
 7  
 import java.text.MessageFormat;
 8  
 import java.util.ResourceBundle;
 9  
 /**
 10  
  * Utility class for localization purpose. TODO : Use it :). Locale locale =
 11  
  * getLocale(request);
 12  
  */
 13  0
 public class MessageUtil {
 14  0
     private static ResourceBundle _resources =
 15  
         ResourceBundle.getBundle("struts.application");
 16  
 
 17  
     private static String getMessageString(String messageKey) {
 18  0
         return _resources.getString(messageKey);
 19  
     }
 20  
 
 21  
 
 22  
     public static String formatMessage(String messageKey) {
 23  0
         MessageFormat mf = new MessageFormat(getMessageString(messageKey));
 24  0
         return mf.format(new Object[0]);
 25  
     }
 26  
 
 27  
 
 28  
     public static String formatMessage(String messageKey, Object arg0) {
 29  0
         MessageFormat mf = new MessageFormat(getMessageString(messageKey));
 30  0
         Object[] args = new Object[1];
 31  0
         args[0] = arg0;
 32  0
         return mf.format(args);
 33  
     }
 34  
 
 35  
 
 36  
     public static String formatMessage(String messageKey, Object arg0, Object arg1) {
 37  0
         MessageFormat mf = new MessageFormat(getMessageString(messageKey));
 38  0
         Object[] args = new Object[] {arg0, arg1};
 39  0
         return mf.format(args);
 40  
     }
 41  
 }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.