ruper2/src/java/core/org/krysalis/ruper/util/text MessageConstants.java,1.10,1.11 Messages.java,1.6,1.7

[email protected]
Newsgroups gmane.comp.krysalis.metamorphosis.cvs
Message-ID <[email protected]>
Update of /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper/util/text
In directory sc8-pr-cvs1:/tmp/cvs-serv11617/src/java/core/org/krysalis/ruper/util/text

Modified Files:
	MessageConstants.java Messages.java 
Log Message:
Renamed Simple Logger to Standard (since it writes to StdOut)
More work on logging and messages

Index: MessageConstants.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper/util/text/MessageConstants.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** MessageConstants.java	22 Sep 2003 20:47:36 -0000	1.10
--- MessageConstants.java	23 Sep 2003 00:19:17 -0000	1.11
***************
*** 17,28 ****
  
  	public static final String GENERAL_EXCEPTION2 =
! 		"RUPER_MSG_GENERAL_EXCEPTION2";
  	public static final String GENERAL_EXCEPTION3 =
! 		"RUPER_MSG_GENERAL_EXCEPTION3";
  
  	//ERRORS
! 	public static final String WRONG_TYPE = "RUPER_MSG_WRONG_TYPE";
  	public static final String NO_SUCH_REFERENCE =
! 		"RUPER_MSG_NO_SUCH_REFERENCE";
  	public static final String CREATE_OBJECT_ERROR = "CREATE_OBJECT_ERROR";
  
--- 17,28 ----
  
  	public static final String GENERAL_EXCEPTION2 =
! 		"GENERAL_EXCEPTION2";
  	public static final String GENERAL_EXCEPTION3 =
! 		"GENERAL_EXCEPTION3";
  
  	//ERRORS
! 	public static final String WRONG_TYPE = "WRONG_TYPE";
  	public static final String NO_SUCH_REFERENCE =
! 		"NO_SUCH_REFERENCE";
  	public static final String CREATE_OBJECT_ERROR = "CREATE_OBJECT_ERROR";
  
***************
*** 31,37 ****
  	public static final String CONFIG = "CONFIG";
  	public static final String CONFIG_PARSER_ERROR =
! 		"RUPER_MSG_CONFIG_PARSER_ERROR";
  	public static final String UNABLE_TO_LOAD_CONFIG =
! 		"RUPER_MSG_UNABLE_TO_LOAD_CONFIG_FILE";
  
  	// Repository Operations..
--- 31,37 ----
  	public static final String CONFIG = "CONFIG";
  	public static final String CONFIG_PARSER_ERROR =
! 		"CONFIG_PARSER_ERROR";
  	public static final String UNABLE_TO_LOAD_CONFIG =
! 		"UNABLE_TO_LOAD_CONFIG";
  
  	// Repository Operations..
***************
*** 55,58 ****
--- 55,60 ----
  	public static final String RESOURCE_REQUEST = "RESOURCE_REQUEST";
  
+ 	public static final String UPDATE_FOUND = "UPDATE_FOUND";
+ 	
  	public static final String NO_RESOURCES_FOUND = "NO_RESOURCES_FOUND";
  	public static final String NO_UPDATE_FOUND = "NO_UPDATE_FOUND";

Index: Messages.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper/util/text/Messages.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Messages.java	22 Sep 2003 21:04:15 -0000	1.6
--- Messages.java	23 Sep 2003 00:19:17 -0000	1.7
***************
*** 5,12 ****
--- 5,17 ----
  
  import java.text.MessageFormat;
+ import java.util.ArrayList;
+ import java.util.Enumeration;
+ import java.util.List;
  import java.util.Locale;
  import java.util.MissingResourceException;
  import java.util.ResourceBundle;
  
+ import org.krysalis.version.util.debug.DebugUtils;
+ 
  /**
   * Formats messages.
***************
*** 26,35 ****
  				ResourceBundle.getBundle(BUNDLE_NAME, Locale.getDefault());
  		}
! 		catch (Exception e) {System.err.println(
! 			"Unable to find Ruper resource bundle ["
! 				+ BUNDLE_NAME
! 				+ "] with locale ["
! 				+ Locale.getDefault()
! 				+ "]");
  		}
  	}
--- 31,41 ----
  				ResourceBundle.getBundle(BUNDLE_NAME, Locale.getDefault());
  		}
! 		catch (Exception e) {
! 			System.err.println(
! 				"Unable to find Ruper resource bundle ["
! 					+ BUNDLE_NAME
! 					+ "] with locale ["
! 					+ Locale.getDefault()
! 					+ "]");
  		}
  	}
***************
*** 67,71 ****
  	 * @return The formatted message.
  	 */
! 	public static String getString(final String code, final Object param1, Object param2) {
  		return getString(code, new Object[] { param1, param2 });
  	}
--- 73,80 ----
  	 * @return The formatted message.
  	 */
! 	public static String getString(
! 		final String code,
! 		final Object param1,
! 		Object param2) {
  		return getString(code, new Object[] { param1, param2 });
  	}
***************
*** 80,84 ****
  	 * @return The formatted message.
  	 */
! 	public static String getString(final String code, final Object param1, Object param2, Object param3) {
  		return getString(code, new Object[] { param1, param2, param3 });
  	}
--- 89,97 ----
  	 * @return The formatted message.
  	 */
! 	public static String getString(
! 		final String code,
! 		final Object param1,
! 		Object param2,
! 		Object param3) {
  		return getString(code, new Object[] { param1, param2, param3 });
  	}
***************
*** 130,137 ****
  		MessageFormat msg = null;
  
! 		String msgText =
! 			(null != l_resourceBundle)
! 				? l_resourceBundle.getString(code)
! 				: null;
  
  		// get the message format
--- 143,156 ----
  		MessageFormat msg = null;
  
! 		String msgText = null;
! 
! 		try {
! 			msgText =
! 				(null != l_resourceBundle)
! 					? l_resourceBundle.getString(code)
! 					: null;
! 		}
! 		catch (MissingResourceException mre) {
! 		}
  
  		// get the message format
***************
*** 141,143 ****
--- 160,184 ----
  		return msg;
  	}
+ 
+ 	static List getCodes() {
+ 		List codes = new ArrayList();
+ 
+ 		for (Enumeration e = l_resourceBundle.getKeys();
+ 			e.hasMoreElements();
+ 			) {
+ 			String code = (String) e.nextElement();
+ 			codes.add(code);
+ 		}
+ 
+ 		return codes;
+ 	}
+ 
+ 	public static void dump() {
+ 		DebugUtils.dump(getCodes());
+ 	}
+ 
+ 	public static void main(String args[]) {
+ 		Messages.dump();
+ 	}
+ 
  }




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.