translator
Class ExtendedResourceManagement

java.lang.Object
  extended by translator.ExtendedResourceManagement

public class ExtendedResourceManagement
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
           
static java.lang.String PROPERTY_FORMAT
           
 
Constructor Summary
ExtendedResourceManagement(java.lang.String filename)
          Generate a new bundle from the given name and language code
ExtendedResourceManagement(java.lang.String filename, java.lang.String formatName)
          Generate a new bundle from the given name and language code
 
Method Summary
protected  void addPropertyResource(java.lang.String filename)
           
 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'
 Translator getTranslator()
          retrieves the actual Translator instance to be used
 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 System.out
 void setTranslator(Translator trans)
          assigns the current Translator for this resource bundle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ASCII_FORMAT

public static final java.lang.String ASCII_FORMAT
See Also:
Constant Field Values

PROPERTY_FORMAT

public static final java.lang.String PROPERTY_FORMAT
See Also:
Constant Field Values
Constructor Detail

ExtendedResourceManagement

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

Parameters:
filename - the file name

ExtendedResourceManagement

public ExtendedResourceManagement(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 chosen format
Method Detail

addPropertyResource

protected void addPropertyResource(java.lang.String filename)
                            throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

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

getTranslator

public Translator getTranslator()
retrieves the actual Translator instance to be used


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 System.out


setTranslator

public void setTranslator(Translator trans)
assigns the current Translator for this resource bundle

Parameters:
trans - the translator to be used. If null, a default translator is used.