Package com.atlassian.bamboo.utils.i18n
Class BambooTextProvider
java.lang.Object
com.opensymphony.xwork2.DefaultTextProvider
com.atlassian.bamboo.struts.BambooDefaultTextProvider
com.atlassian.bamboo.utils.i18n.BambooTextProvider
- All Implemented Interfaces:
com.atlassian.struts.TextProvider
,com.opensymphony.xwork2.TextProvider
,com.opensymphony.xwork2.Unchainable
,Serializable
,org.apache.struts2.Unchainable
public class BambooTextProvider
extends BambooDefaultTextProvider
implements com.atlassian.struts.TextProvider
This class aims to allow a different classloader to be defined and propagated to all TextProvider instances (there
are the one managed by Spring and
In Bamboo, a different classloader is used to load Plugins and their resources. This classloader is set in
BambooPluginManager after all plugins are loaded. Then, it is propagated to existing TextProvider instances.
This class is a wrapper around the DefaultTextProvider class from xwork, and overrides all methods that retrieve
i18n resources to use the classloader set in BambooPluginManager.
- See Also:
-
Field Summary
Fields inherited from class com.opensymphony.xwork2.DefaultTextProvider
localizedTextProvider
-
Method Summary
Modifier and TypeMethodDescriptionstatic BambooTextProvider
static ClassLoader
getText
(String key, String defaultValue, String[] args, com.opensymphony.xwork2.util.ValueStack stack) getText
(String key, String defaultValue, List<?> args, com.opensymphony.xwork2.util.ValueStack stack) getTexts()
boolean
static void
setWebAppClassLoader
(ClassLoader classLoader) Allows to set the classloader that will be used to retrieve i18n resources.Methods inherited from class com.opensymphony.xwork2.DefaultTextProvider
setLocalizedTextProvider
-
Method Details
-
getInstance
-
setWebAppClassLoader
Allows to set the classloader that will be used to retrieve i18n resources. Multiple threads with their own instance of this class will use the given classloader immediately, as it is stored in a static (volatile) field.- Parameters:
classLoader
- the class loader to use
-
getMainAppClassloader
-
getText
- Specified by:
getText
in interfacecom.opensymphony.xwork2.TextProvider
- Overrides:
getText
in classBambooDefaultTextProvider
-
getText
- Specified by:
getText
in interfacecom.opensymphony.xwork2.TextProvider
- Overrides:
getText
in classcom.opensymphony.xwork2.DefaultTextProvider
-
getText
- Specified by:
getText
in interfacecom.opensymphony.xwork2.TextProvider
- Overrides:
getText
in classBambooDefaultTextProvider
-
getText
- Specified by:
getText
in interfacecom.opensymphony.xwork2.TextProvider
- Overrides:
getText
in classBambooDefaultTextProvider
-
getText
- Specified by:
getText
in interfacecom.opensymphony.xwork2.TextProvider
- Overrides:
getText
in classBambooDefaultTextProvider
-
getText
- Specified by:
getText
in interfacecom.opensymphony.xwork2.TextProvider
- Overrides:
getText
in classBambooDefaultTextProvider
-
getText
- Specified by:
getText
in interfacecom.opensymphony.xwork2.TextProvider
- Overrides:
getText
in classcom.opensymphony.xwork2.DefaultTextProvider
-
getText
public String getText(String key, String defaultValue, List<?> args, com.opensymphony.xwork2.util.ValueStack stack) - Specified by:
getText
in interfacecom.opensymphony.xwork2.TextProvider
- Overrides:
getText
in classcom.opensymphony.xwork2.DefaultTextProvider
-
getText
public String getText(String key, String defaultValue, String[] args, com.opensymphony.xwork2.util.ValueStack stack) - Specified by:
getText
in interfacecom.opensymphony.xwork2.TextProvider
- Overrides:
getText
in classcom.opensymphony.xwork2.DefaultTextProvider
-
getTexts
- Specified by:
getTexts
in interfacecom.opensymphony.xwork2.TextProvider
- Overrides:
getTexts
in classBambooDefaultTextProvider
-
getTexts
- Specified by:
getTexts
in interfacecom.opensymphony.xwork2.TextProvider
- Overrides:
getTexts
in classcom.opensymphony.xwork2.DefaultTextProvider
-
hasKey
- Specified by:
hasKey
in interfacecom.opensymphony.xwork2.TextProvider
- Overrides:
hasKey
in classcom.opensymphony.xwork2.DefaultTextProvider
-