planetj.common
Class TranslationManager

java.lang.Object
  extended byplanetj.common.TranslationManager

public class TranslationManager
extends java.lang.Object


Field Summary
static java.util.Locale SPANISH
           
 
Constructor Summary
TranslationManager()
           
 
Method Summary
 java.util.ResourceBundle getCurrentLabelsBundle()
          Gets the CurrentBundle for the being used for this translationManager.
 java.util.Locale getCurrentLocale()
          Gets the current Locale being used by the TranslationManager.
 java.util.ResourceBundle getCurrentMessageBundle()
          Gets the CurrentBundle for the being used for this translationManager.
 java.lang.String getCurrentPropFileBundle()
          Gets the CurrentBundle for the being used for this translationManager.
 java.lang.String getMessageTranslation(java.lang.String key)
          Gets the value of translation.
 java.lang.String getMessageTranslation(java.lang.String key, java.lang.Object[] parms)
          Gets the value of translation.
 java.lang.Object getTranslation(java.lang.Object translationId)
          Gets the value of translation.
 java.lang.String getTranslation(java.lang.String key)
          Gets the value of translation.
 java.lang.Object getTranslation(java.util.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(java.util.Locale newLocale)
          Sets the CurrentLocale to be used for this translationManager.
 void setPropertyBundleForLabels(java.lang.String pb)
          allows user to set a property bundle for labels to their choice.
 void setPropertyBundleForMessages(java.lang.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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPANISH

public static final java.util.Locale SPANISH
Constructor Detail

TranslationManager

public TranslationManager()
Method Detail

getCurrentLabelsBundle

public java.util.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 java.util.Locale getCurrentLocale()
Gets the current Locale being used by the TranslationManager.

Returns:
the Locale that is being used.

getCurrentMessageBundle

public java.util.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 java.lang.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 java.lang.String getMessageTranslation(java.lang.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 java.lang.String getMessageTranslation(java.lang.String key,
                                              java.lang.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 java.lang.Object getTranslation(java.lang.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 java.lang.String getTranslation(java.lang.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 java.lang.Object getTranslation(java.util.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(java.util.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(java.lang.String pb)
allows user to set a property bundle for labels to their choice. Property Bundles are for external use.


setPropertyBundleForMessages

public void setPropertyBundleForMessages(java.lang.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.