com.edsdev.jconvert.util
Class Messages

java.lang.Object
  extended bycom.edsdev.jconvert.util.Messages

public class Messages
extends java.lang.Object

This class is used to load String resources specific to the current Locale

Author:
Ed Sarrazin Created on Sep 26, 2007 7:50:47 PM

Constructor Summary
Messages()
           
 
Method Summary
static java.lang.String getResource(java.lang.String key)
          Gets the resource specific to the specified key
static java.lang.String getResource(java.lang.String key, java.lang.Object[] values)
          Gets the resource specific to the specified key, replacing the parmeters in the string with the values passed in
static java.lang.String getResource(java.lang.String key, java.lang.String replacementValue)
          Gets the resource specific to the specified key
static java.lang.String getResource(java.lang.String key, java.lang.String value1, java.lang.String value2)
          Gets the resource specific to the specified key, replacing the parmeters in the string with the two passed in values
static java.lang.String getReverseLookup(java.lang.String value)
          Special method!!! This is messed up, but we need to be able to lookup the original key from the resource bundle from the target resource.
static java.lang.String getUnitTranslation(java.lang.String key)
          Specialized translation designed to handle missing resources in the bundle.
static void resetBundle()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Messages

public Messages()
Method Detail

resetBundle

public static void resetBundle()

getResource

public static java.lang.String getResource(java.lang.String key)
Gets the resource specific to the specified key

Parameters:
key - String value key that you are looking up
Returns:
String result

getResource

public static java.lang.String getResource(java.lang.String key,
                                           java.lang.String replacementValue)
Gets the resource specific to the specified key

Parameters:
key - String value key that you are looking up
replacementValue - replaces the first parameter in the string result with this value
Returns:
String result

getResource

public static java.lang.String getResource(java.lang.String key,
                                           java.lang.String value1,
                                           java.lang.String value2)
Gets the resource specific to the specified key, replacing the parmeters in the string with the two passed in values

Parameters:
key - String value key that you are looking up
value1 - replaces the first parameter in the string result with this value
value2 - replaces the second parameter in the string result with this value
Returns:
String result

getResource

public static java.lang.String getResource(java.lang.String key,
                                           java.lang.Object[] values)
Gets the resource specific to the specified key, replacing the parmeters in the string with the values passed in

Parameters:
key - String value key that you are looking up
values - Object array of values to replace in the string result.
Returns:
String result

getUnitTranslation

public static java.lang.String getUnitTranslation(java.lang.String key)
Specialized translation designed to handle missing resources in the bundle. This searched for the key, and if the key is not found, then the key is returned. This basically handles translating the actual units and if there is no translation found, it just uses the value in the convert file.

Parameters:
key - String value key that you are looking up
Returns:
String result

getReverseLookup

public static java.lang.String getReverseLookup(java.lang.String value)
Special method!!! This is messed up, but we need to be able to lookup the original key from the resource bundle from the target resource. For instance if someone types in something in their own language, we need to get the source value. Returns the value if the key is not found.

Parameters:
value - Source Value in the bundle
Returns:
Actual key of this value in the bundle


JConvert - opensource project by Ed Sarrazin