translator
Class StaticExtendedResourceBundle

java.lang.Object
  extended by translator.StaticExtendedResourceBundle

public class StaticExtendedResourceBundle
extends java.lang.Object

A special type of PropertyResourceBundle support

Version:
1.1 2000-01-11
Author:
Guido Rößling ( roessling@acm.org)

Field Summary
static java.lang.String ASCII_FORMAT
          the default file format
(package private)  java.util.PropertyResourceBundle bundle
          The property resource bundle used for storing the current resources
static java.lang.String PROPERTY_FORMAT
          the default name for the property format
 
Constructor Summary
StaticExtendedResourceBundle(java.lang.String filename)
          Generate a new bundle from the given name and language code
StaticExtendedResourceBundle(java.lang.String filename, java.lang.String formatName)
          Generate a new bundle from the given name and language code
 
Method Summary
 java.lang.String[] getKeys()
          Retrieve the keys of this resource
 java.lang.String getMessage(java.lang.String key)
          Convenvience wrapper for retrieving the message for key 'key' Internally invokes getMessage(key, true)
 java.lang.String getMessage(java.lang.String key, boolean warnOnError)
          Method for retrieving the message for key 'key'
 void printProperties()
          Print the properties stored in the bundle to System.out
 void printProperties(java.io.PrintStream outputStream)
          Print the properties stored in the bundle to the given output stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_FORMAT

public static final java.lang.String PROPERTY_FORMAT
the default name for the property format

See Also:
Constant Field Values

ASCII_FORMAT

public static final java.lang.String ASCII_FORMAT
the default file format

See Also:
Constant Field Values

bundle

java.util.PropertyResourceBundle bundle
The property resource bundle used for storing the current resources

Constructor Detail

StaticExtendedResourceBundle

public StaticExtendedResourceBundle(java.lang.String filename)
Generate a new bundle from the given name and language code

Parameters:
filename - the file name

StaticExtendedResourceBundle

public StaticExtendedResourceBundle(java.lang.String filename,
                                    java.lang.String formatName)
Generate a new bundle from the given name and language code

Parameters:
filename - the file name
formatName - the name of the format file
Method Detail

getKeys

public java.lang.String[] getKeys()
Retrieve the keys of this resource

Returns:
a String[] of all keys in this resource

getMessage

public java.lang.String getMessage(java.lang.String key)
Convenvience wrapper for retrieving the message for key 'key' Internally invokes getMessage(key, true)

Parameters:
key - the key of the message to retrieve
Returns:
the retrieved message or null, if no message was found
See Also:
getMessage(String, boolean)

getMessage

public java.lang.String getMessage(java.lang.String key,
                                   boolean warnOnError)
Method for retrieving the message for key 'key'

Parameters:
key - the key of the message to retrieve
warnOnError - if true, display a warning on System.out if no appropriate resource was found.
Returns:
the retrieved message or null, if no message was found

printProperties

public void printProperties()
Print the properties stored in the bundle to System.out


printProperties

public void printProperties(java.io.PrintStream outputStream)
Print the properties stored in the bundle to the given output stream

Parameters:
outputStream - the OutputStream on which the results are to be written