public class TranslationDataAdapter
extends java.lang.Object
| Constructor and Description |
|---|
TranslationDataAdapter(PluginData pluginData,
java.lang.Class<?> viewInterface) |
TranslationDataAdapter(java.lang.String pluginID,
java.lang.Class<?> viewInterface,
java.util.Map<java.lang.String,java.lang.String> pluginData) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getPluginID() |
java.util.Set<java.lang.String> |
getTranslatableAttributes() |
java.util.Locale[] |
getUsedLocales() |
java.lang.String |
getValue(java.lang.String attrName,
java.util.Locale locale)
Returns the value of the specified attribute in the given locale.
|
void |
removeTranslations(java.util.Locale locale)
Removes all translations for the given locale.
|
void |
removeValue(java.lang.String attrName,
java.util.Locale locale) |
void |
setValue(java.lang.String attrName,
java.lang.String value,
java.util.Locale locale)
Sets the value of the specified attribute in the given locale to the given
value.
|
public TranslationDataAdapter(PluginData pluginData, java.lang.Class<?> viewInterface)
public TranslationDataAdapter(java.lang.String pluginID,
java.lang.Class<?> viewInterface,
java.util.Map<java.lang.String,java.lang.String> pluginData)
public java.util.Set<java.lang.String> getTranslatableAttributes()
public java.lang.String getPluginID()
public java.lang.String getValue(java.lang.String attrName,
java.util.Locale locale)
attrName - name of the desired attributelocale - the locale for which to get the translated value; use
null to get the default valuenullpublic void setValue(java.lang.String attrName,
java.lang.String value,
java.util.Locale locale)
attrName - name of the desired attributevalue - the new value of the specified attribute in the given localelocale - the locale for which to set the translated value; use
null to set the default valuepublic void removeValue(java.lang.String attrName,
java.util.Locale locale)
attrName - name of the desired attributelocale - the locale for which to remove the translated value; use
null to remove the default valuepublic void removeTranslations(java.util.Locale locale)
locale - the locale for which to remove all translationspublic java.util.Locale[] getUsedLocales()