org.pz.platypus
Class Literals
java.lang.Object
org.pz.platypus.PropertyFile
org.pz.platypus.Literals
public class Literals
- extends PropertyFile
Handles getting literal strings from resource bundle. The default resource bundle, called
Platypus.properties, must be present or the program aborts. It is in US English. If another
language is used, please see documentation to access the appropriate resource bundle.
- Author:
- alb
Constructor Summary |
Literals()
This constructor is included here only because it facilitates writing
mock Literals class for testing. |
Literals(java.lang.String resourceName)
Open a resource bundle with the name: resourceName.properties
In the event the resource bundle cannot be found, the program
shuts down. |
Method Summary |
java.lang.String |
getLit(java.lang.String key)
Looks up a literal in the resource bundle. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Literals
public Literals()
- This constructor is included here only because it facilitates writing
mock Literals class for testing. It's not called from Platypus working code.
Literals
public Literals(java.lang.String resourceName)
throws java.util.MissingResourceException
- Open a resource bundle with the name: resourceName.properties
In the event the resource bundle cannot be found, the program
shuts down. Clearly, this is a fatal error.
- Parameters:
resourceName
- name of the resource bundle
- Throws:
java.util.MissingResourceException
- if resource is not found.
getLit
public java.lang.String getLit(java.lang.String key)
- Looks up a literal in the resource bundle. In the event of error,
it returns a string consisting of a single blank. In this manner,
the program will continue to work if someone has diddled with the
resource file.
- Parameters:
key
- the name of the literal to be looked up
- Returns:
- the literal String that was searched for
Copyright © 2008-10 Pacific Data Works LLC