Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jdbf.castor
Class Messages  view Messages download Messages.java

java.lang.Object
  extended byorg.jdbf.castor.Messages

public class Messages
extends java.lang.Object

I18N message formatting class. A static factory for obtaining messages and formatting messages with arguments.

The resource file org.exolab.castor.util.resources.messages contains a list of all the messages in English. Additional resource files can be added for other languages and locales by placing them in the same package with a language/locale prefix. See the I18N documentation and use of resource bundles in the JDK docs.

Version:
$Revision: 1.4 $ $Date: 2003/02/17 13:00:51 $

Nested Class Summary
(package private) static class Messages.EmptyResourceBundle
           
 
Field Summary
private static java.util.Hashtable _formats
          Once a format has been created once, it is cached here.
private static java.util.ResourceBundle _messages
          The resource bundle holds all the messages.
 
Constructor Summary
Messages()
           
 
Method Summary
static java.lang.String format(java.lang.String message, java.lang.Object arg1)
          Format the named message using a single argument and return the full message text.
static java.lang.String format(java.lang.String message, java.lang.Object[] args)
          Format the named message using any number of arguments and return the full message text.
static java.lang.String format(java.lang.String message, java.lang.Object arg1, java.lang.Object arg2)
          Format the named message using two argument and return the full message text.
static java.lang.String format(java.lang.String message, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
          Format the named message using three argument and return the full message text.
static java.lang.String message(java.lang.String message)
          Return the text of the named message without formatting.
static void setLocale(java.lang.String resourceName)
           
static void setLocale(java.lang.String resourceName, java.util.Locale locale)
          Set the locale to use for loading messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_messages

private static java.util.ResourceBundle _messages
The resource bundle holds all the messages.


_formats

private static java.util.Hashtable _formats
Once a format has been created once, it is cached here.

Constructor Detail

Messages

public Messages()
Method Detail

format

public static java.lang.String format(java.lang.String message,
                                      java.lang.Object arg1)
Format the named message using a single argument and return the full message text.


format

public static java.lang.String format(java.lang.String message,
                                      java.lang.Object arg1,
                                      java.lang.Object arg2)
Format the named message using two argument and return the full message text.


format

public static java.lang.String format(java.lang.String message,
                                      java.lang.Object arg1,
                                      java.lang.Object arg2,
                                      java.lang.Object arg3)
Format the named message using three argument and return the full message text.


format

public static java.lang.String format(java.lang.String message,
                                      java.lang.Object[] args)
Format the named message using any number of arguments and return the full message text.


message

public static java.lang.String message(java.lang.String message)
Return the text of the named message without formatting.


setLocale

public static void setLocale(java.lang.String resourceName,
                             java.util.Locale locale)
Set the locale to use for loading messages. Calling this method will reload all the messages based on the new locale name.


setLocale

public static void setLocale(java.lang.String resourceName)