Package org.apache.struts2.text
Class CompositeTextProvider
java.lang.Object
org.apache.struts2.text.CompositeTextProvider
- All Implemented Interfaces:
- TextProvider
This is a composite 
TextProvider that takes in an array or List of TextProviders, it will
 consult each of them in order to get a composite result. To know how each method behaves, please refer to the
 javadoc for each methods.- Author:
- tmjee
- 
Constructor SummaryConstructorsConstructorDescriptionCompositeTextProvider(List<TextProvider> textProviders) Instantiates aCompositeTextProviderwith some predefinedtextProviders.CompositeTextProvider(TextProvider[] textProviders) Instantiates aCompositeTextProviderwith some predefinedtextProviders.
- 
Method SummaryModifier and TypeMethodDescriptionIt will consult eachTextProviders and return the first valid message for thiskeyIt will consult eachTextProviders and return the first valid message for thiskeybefore returningdefaultValueif every else fails.It will consult eachTextProviders and return the first valid message for thiskey.It will consult eachTextProviders and return the first valid message for thiskey, before returningdefaultValueif every else fails.It will consult eachTextProviders and return the first valid message for thiskey, before returningdefaultValue.getText(String key, String defaultValue, String[] args, ValueStack stack) It will consult eachTextProviders and return the first valid message for thiskey, before returningdefaultValueIt will consult eachTextProviders and return the first valid message for thiskey, before returningdefaultValuegetText(String key, String defaultValue, List<?> args, ValueStack stack) It will consult eachTextProviders and return the first valid message for thiskey, before returningdefaultValueIt will consult eachTextProviders and return the first valid message for thiskey.getTexts()It will consult eachTextProviders and return the first non-nullResourceBundle.It will consult eachTextProviders and return the first non-nullResourceBundle.booleanIt will consult each individualTextProviders and return true if either one of theTextProvider" has such akeyelse false.
- 
Constructor Details- 
CompositeTextProviderInstantiates aCompositeTextProviderwith some predefinedtextProviders.- Parameters:
- textProviders- list of text providers
 
- 
CompositeTextProviderInstantiates aCompositeTextProviderwith some predefinedtextProviders.- Parameters:
- textProviders- array of text providers
 
 
- 
- 
Method Details- 
hasKeyIt will consult each individualTextProviders and return true if either one of theTextProvider" has such akeyelse false.- Specified by:
- hasKeyin interface- TextProvider
- Parameters:
- key- The key to lookup in resource bundles.
- Returns:
- true, if the requested key is found in one of the resource bundles.
- See Also:
 
- 
getTextIt will consult eachTextProviders and return the first valid message for thiskey- Specified by:
- getTextin interface- TextProvider
- Parameters:
- key- The key to lookup in resource bundles.
- Returns:
- The i18n text for the requested key.
- See Also:
 
- 
getTextIt will consult eachTextProviders and return the first valid message for thiskeybefore returningdefaultValueif every else fails.- Specified by:
- getTextin interface- TextProvider
- Parameters:
- key- the message key
- defaultValue- the default value
- Returns:
- the first valid message for the key or default value
- See Also:
 
- 
getTextIt will consult eachTextProviders and return the first valid message for thiskey, before returningdefaultValueif every else fails.- Specified by:
- getTextin interface- TextProvider
- Parameters:
- key- the message key
- defaultValue- the default value
- obj- object
- Returns:
- the first valid message for the key or default value
- See Also:
 
- 
getTextIt will consult eachTextProviders and return the first valid message for thiskey.- Specified by:
- getTextin interface- TextProvider
- Parameters:
- key- the message key
- args- additional arguments
- Returns:
- the first valid message for the key
- See Also:
 
- 
getTextIt will consult eachTextProviders and return the first valid message for thiskey.- Specified by:
- getTextin interface- TextProvider
- Parameters:
- key- the message key
- args- additional arguments
- Returns:
- the first valid message for the key or default value
- See Also:
 
- 
getTextIt will consult eachTextProviders and return the first valid message for thiskey, before returningdefaultValue- Specified by:
- getTextin interface- TextProvider
- Parameters:
- key- the message key
- defaultValue- the default value
- args- additional arguments
- Returns:
- the first valid message for the key or default value
- See Also:
 
- 
getTextIt will consult eachTextProviders and return the first valid message for thiskey, before returningdefaultValue.- Specified by:
- getTextin interface- TextProvider
- Parameters:
- key- the message key
- defaultValue- the default value
- args- additional arguments
- Returns:
- the first valid message for the key or default value
- See Also:
 
- 
getTextIt will consult eachTextProviders and return the first valid message for thiskey, before returningdefaultValue- Specified by:
- getTextin interface- TextProvider
- Parameters:
- key- the message key
- defaultValue- the default value
- args- additional arguments
- stack- the value stack
- Returns:
- the first valid message for the key or default value
- See Also:
 
- 
getTextIt will consult eachTextProviders and return the first valid message for thiskey, before returningdefaultValue- Specified by:
- getTextin interface- TextProvider
- Parameters:
- key- the message key
- defaultValue- the default value
- args- additional arguments
- stack- the value stack
- Returns:
- the first valid message for the key or default value
- See Also:
 
- 
getTextsIt will consult eachTextProviders and return the first non-nullResourceBundle.- Specified by:
- getTextsin interface- TextProvider
- Parameters:
- bundleName- the bundle name
- Returns:
- the resource bundle found for bundle name
- See Also:
 
- 
getTextsIt will consult eachTextProviders and return the first non-nullResourceBundle.- Specified by:
- getTextsin interface- TextProvider
- Returns:
- the resource bundle
- See Also:
 
 
-