org.jdiseq.util
Class MessageUtil

java.lang.Object
  extended byorg.jdiseq.util.MessageUtil

public class MessageUtil
extends java.lang.Object

MessageUtil class which holds references to localized messages.

Since:
1.0
Version:
$Id $
Author:
Trond Andersen

Method Summary
protected  java.util.ResourceBundle createBundle(java.lang.String messageFile, java.util.Locale locale)
          Initializes the bundle towards the message file
static MessageUtil getInstance()
          Initializes the MessageUtil class.
 java.lang.String getMessage(java.lang.String messageKey)
          Retrieved the text message for a given locale.
static void initialize(java.util.Locale locale)
          Initializes the class with the given locale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initialize

public static void initialize(java.util.Locale locale)
Initializes the class with the given locale. If this method isn't run, MessageUtil will use default locale.

Parameters:
locale - given by the application

getInstance

public static MessageUtil getInstance()
Initializes the MessageUtil class.

Returns:
instance of MessageUtil

getMessage

public java.lang.String getMessage(java.lang.String messageKey)
Retrieved the text message for a given locale.

Parameters:
messageKey - key for getting the localized messages
Returns:
Localized message

createBundle

protected java.util.ResourceBundle createBundle(java.lang.String messageFile,
                                                java.util.Locale locale)
Initializes the bundle towards the message file

Parameters:
messageFile - name of the file containing the messages
locale - for the running application
Returns:
Resource having all the messages


Copyright © 2003 SourceForge.net. All Rights Reserved.