| java.lang.Object org.springframework.context.support.AbstractMessageSource org.springframework.context.support.ResourceBundleMessageSource
Method Summary | |
protected ResourceBundle | doGetBundle(String basename, Locale locale) Obtain the resource bundle for the given basename and Locale. | protected ClassLoader | getBundleClassLoader() Return the ClassLoader to load resource bundles with. | protected MessageFormat | getMessageFormat(ResourceBundle bundle, String code, Locale locale) Return a MessageFormat for the given bundle and code,
fetching already generated MessageFormats from the cache. | protected ResourceBundle | getResourceBundle(String basename, Locale locale) Return a ResourceBundle for the given basename and code,
fetching already generated MessageFormats from the cache. | protected MessageFormat | resolveCode(String code, Locale locale) Resolves the given message code as key in the registered resource bundles,
using a cached MessageFormat instance per message code. | protected String | resolveCodeWithoutArguments(String code, Locale locale) Resolves the given message code as key in the registered resource bundles,
returning the value found in the bundle as-is (without MessageFormat parsing). | public void | setBasename(String basename) Set a single basename, following
java.util.ResourceBundle conventions:
essentially, a fully-qualified classpath location. | public void | setBasenames(String[] basenames) Set an array of basenames, each following
java.util.ResourceBundle conventions: essentially, a fully-qualified classpath location. | public void | setBeanClassLoader(ClassLoader classLoader) | public void | setBundleClassLoader(ClassLoader classLoader) Set the ClassLoader to load resource bundles with. | public String | toString() Show the configuration of this MessageSource. |
getMessageFormat | protected MessageFormat getMessageFormat(ResourceBundle bundle, String code, Locale locale) throws MissingResourceException(Code) | | Return a MessageFormat for the given bundle and code,
fetching already generated MessageFormats from the cache.
Parameters: bundle - the ResourceBundle to work on Parameters: code - the message code to retrieve Parameters: locale - the Locale to use to build the MessageFormat the resulting MessageFormat, or null if no messagedefined for the given code throws: MissingResourceException - if thrown by the ResourceBundle |
getResourceBundle | protected ResourceBundle getResourceBundle(String basename, Locale locale)(Code) | | Return a ResourceBundle for the given basename and code,
fetching already generated MessageFormats from the cache.
Parameters: basename - the basename of the ResourceBundle Parameters: locale - the Locale to find the ResourceBundle for the resulting ResourceBundle, or null if nonefound for the given basename and Locale |
resolveCode | protected MessageFormat resolveCode(String code, Locale locale)(Code) | | Resolves the given message code as key in the registered resource bundles,
using a cached MessageFormat instance per message code.
|
resolveCodeWithoutArguments | protected String resolveCodeWithoutArguments(String code, Locale locale)(Code) | | Resolves the given message code as key in the registered resource bundles,
returning the value found in the bundle as-is (without MessageFormat parsing).
|
setBasename | public void setBasename(String basename)(Code) | | Set a single basename, following
java.util.ResourceBundle conventions:
essentially, a fully-qualified classpath location. If it doesn't contain a
package qualifier (such as org.mypackage ), it will be resolved
from the classpath root.
Messages will normally be held in the "/lib" or "/classes" directory of
a web application's WAR structure. They can also be held in jar files on
the class path.
Note that ResourceBundle names are effectively classpath locations: As a
consequence, the JDK's standard ResourceBundle treats dots as package separators.
This means that "test.theme" is effectively equivalent to "test/theme",
just like it is for programmatic java.util.ResourceBundle usage.
See Also: ResourceBundleMessageSource.setBasenames See Also: java.util.ResourceBundle.getBundle(String) |
setBasenames | public void setBasenames(String[] basenames)(Code) | | Set an array of basenames, each following
java.util.ResourceBundle conventions: essentially, a fully-qualified classpath location. If it
doesn't contain a package qualifier (such as org.mypackage ),
it will be resolved from the classpath root.
The associated resource bundles will be checked sequentially
when resolving a message code. Note that message definitions in a
previous resource bundle will override ones in a later bundle,
due to the sequential lookup.
Note that ResourceBundle names are effectively classpath locations: As a
consequence, the JDK's standard ResourceBundle treats dots as package separators.
This means that "test.theme" is effectively equivalent to "test/theme",
just like it is for programmatic java.util.ResourceBundle usage.
See Also: ResourceBundleMessageSource.setBasename See Also: java.util.ResourceBundle.getBundle(String) |
toString | public String toString()(Code) | | Show the configuration of this MessageSource.
|
Fields inherited from org.springframework.context.support.AbstractMessageSource | final protected Log logger(Code)(Java Doc)
|
Methods inherited from org.springframework.context.support.AbstractMessageSource | protected MessageFormat createMessageFormat(String msg, Locale locale)(Code)(Java Doc) protected String formatMessage(String msg, Object[] args, Locale locale)(Code)(Java Doc) protected String getDefaultMessage(String code)(Code)(Java Doc) final public String getMessage(String code, Object[] args, String defaultMessage, Locale locale)(Code)(Java Doc) final public String getMessage(String code, Object[] args, Locale locale) throws NoSuchMessageException(Code)(Java Doc) final public String getMessage(MessageSourceResolvable resolvable, Locale locale) throws NoSuchMessageException(Code)(Java Doc) protected String getMessageFromParent(String code, Object[] args, Locale locale)(Code)(Java Doc) protected String getMessageInternal(String code, Object[] args, Locale locale)(Code)(Java Doc) public MessageSource getParentMessageSource()(Code)(Java Doc) protected boolean isAlwaysUseMessageFormat()(Code)(Java Doc) protected boolean isUseCodeAsDefaultMessage()(Code)(Java Doc) protected String renderDefaultMessage(String defaultMessage, Object[] args, Locale locale)(Code)(Java Doc) protected Object[] resolveArguments(Object[] args, Locale locale)(Code)(Java Doc) abstract protected MessageFormat resolveCode(String code, Locale locale)(Code)(Java Doc) protected String resolveCodeWithoutArguments(String code, Locale locale)(Code)(Java Doc) public void setAlwaysUseMessageFormat(boolean alwaysUseMessageFormat)(Code)(Java Doc) public void setParentMessageSource(MessageSource parent)(Code)(Java Doc) public void setUseCodeAsDefaultMessage(boolean useCodeAsDefaultMessage)(Code)(Java Doc)
|
|
|