planetj.common
Class TranslationManager

java.lang.Object
  |
  +--planetj.common.TranslationManager

public class TranslationManager
extends Object


Field Summary
static Locale SPANISH
           
 
Constructor Summary
TranslationManager()
           
 
Method Summary
 ResourceBundle getCurrentLabelsBundle()
          Gets the CurrentBundle for the being used for this translationManager.
 Locale getCurrentLocale()
          Gets the current Locale being used by the TranslationManager.
 ResourceBundle getCurrentMessageBundle()
          Gets the CurrentBundle for the being used for this translationManager.
 String getCurrentPropFileBundle()
          Gets the CurrentBundle for the being used for this translationManager.
 String getMessageTranslation(String key)
          Gets the value of translation.
 String getMessageTranslation(String key, Object[] parms)
          Gets the value of translation.
 Object getTranslation(Object translationId)
          Gets the value of translation.
 String getTranslation(String key)
          Gets the value of translation.
 Object getTranslation(Vector translationId)
          Gets the value of translation.
static void resetSingleton()
          Reset the cached singleton so that future selects can refresh the data from the database.
 void setCurrentLocale(Locale newLocale)
          Sets the CurrentLocale to be used for this translationManager.
 void setPropertyBundleForLabels(String pb)
          allows user to set a property bundle for labels to their choice.
 void setPropertyBundleForMessages(String pb)
          allows user to set a property bundle for messages to their choice.
 void setUseDefaultPropertyFileForComponentText(boolean answer)
          if user specifies they want a external property file as the translation key then this need to be set to true
static TranslationManager singleton()
          Return a single instance of this class.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPANISH

public static final Locale SPANISH
Constructor Detail

TranslationManager

public TranslationManager()
Method Detail

getCurrentLabelsBundle

public ResourceBundle getCurrentLabelsBundle()
Gets the CurrentBundle for the being used for this translationManager.

Returns:
a String that contains the Bundle being used by this TranslationManager.

getCurrentLocale

public Locale getCurrentLocale()
Gets the current Locale being used by the TranslationManager.

Returns:
the Locale that is being used.

getCurrentMessageBundle

public ResourceBundle getCurrentMessageBundle()
Gets the CurrentBundle for the being used for this translationManager.

Returns:
a String that contains the Bundle being used by this TranslationManager.

getCurrentPropFileBundle

public String getCurrentPropFileBundle()
Gets the CurrentBundle for the being used for this translationManager.

Returns:
a String that contains the Bundle being used by this TranslationManager.

getMessageTranslation

public String getMessageTranslation(String key)
Gets the value of translation.

Parameters:
key - the String that is to be translated.
Returns:
an Object that contains the currentLocales translation of key.

getMessageTranslation

public String getMessageTranslation(String key,
                                    Object[] parms)
Gets the value of translation.

Parameters:
key - the String that is to be translated.
Returns:
an Object that contains the currentLocales translation of key.

getTranslation

public Object getTranslation(Object translationId)
Gets the value of translation.

Parameters:
translationId - the String or Vector of Strings that are to be translated.
Returns:
an Object that contains the currentLocale's translation: as a single String if translationId was a single String, else as a Vector of translation Strings.

getTranslation

public String getTranslation(String key)
Gets the value of translation.

Parameters:
key - the String that is to be translated.
Returns:
an Object that contains the currentLocales translation of key.

getTranslation

public Object getTranslation(Vector translationId)
Gets the value of translation.

Parameters:
translationId - the Vector of Strings that are to be translated.
Returns:
a Vector that contains the currentLocale's translation: as a Vector of translation Strings.

resetSingleton

public static void resetSingleton()
Reset the cached singleton so that future selects can refresh the data from the database.


setCurrentLocale

public void setCurrentLocale(Locale newLocale)
Sets the CurrentLocale to be used for this translationManager.

Parameters:
newLocale - the Locale that is to be used by this TranslationManager.

setPropertyBundleForLabels

public void setPropertyBundleForLabels(String pb)
allows user to set a property bundle for labels to their choice. Property Bundles are for external use.


setPropertyBundleForMessages

public void setPropertyBundleForMessages(String pb)
allows user to set a property bundle for messages to their choice. Property Bundles are for external use.


setUseDefaultPropertyFileForComponentText

public void setUseDefaultPropertyFileForComponentText(boolean answer)
if user specifies they want a external property file as the translation key then this need to be set to true


singleton

public static TranslationManager singleton()
Return a single instance of this class.