public class

MessageSourceResourceBundle

extends ResourceBundle
java.lang.Object
   ↳ java.util.ResourceBundle
     ↳ org.springframework.context.support.MessageSourceResourceBundle

Class Overview

Helper class that allows for accessing a Spring MessageSource as a java.util.ResourceBundle. Used for example to expose a Spring MessageSource to JSTL web views.

Summary

[Expand]
Inherited Fields
From class java.util.ResourceBundle
Public Constructors
MessageSourceResourceBundle(MessageSource source, Locale locale)
Create a new MessageSourceResourceBundle for the given MessageSource and Locale.
MessageSourceResourceBundle(MessageSource source, Locale locale, ResourceBundle parent)
Create a new MessageSourceResourceBundle for the given MessageSource and Locale.
Public Methods
Enumeration<String> getKeys()
This implementation returns null, as a MessageSource does not allow for enumerating the defined message codes.
Locale getLocale()
This implementation exposes the specified Locale for introspection through the standard ResourceBundle.getLocale() method.
Protected Methods
Object handleGetObject(String code)
This implementation resolves the code in the MessageSource.
[Expand]
Inherited Methods
From class java.util.ResourceBundle
From class java.lang.Object

Public Constructors

public MessageSourceResourceBundle (MessageSource source, Locale locale)

Create a new MessageSourceResourceBundle for the given MessageSource and Locale.

Parameters
source the MessageSource to retrieve messages from
locale the Locale to retrieve messages for

public MessageSourceResourceBundle (MessageSource source, Locale locale, ResourceBundle parent)

Create a new MessageSourceResourceBundle for the given MessageSource and Locale.

Parameters
source the MessageSource to retrieve messages from
locale the Locale to retrieve messages for
parent the parent ResourceBundle to delegate to if no local message found

Public Methods

public Enumeration<String> getKeys ()

This implementation returns null, as a MessageSource does not allow for enumerating the defined message codes.

public Locale getLocale ()

This implementation exposes the specified Locale for introspection through the standard ResourceBundle.getLocale() method.

Protected Methods

protected Object handleGetObject (String code)

This implementation resolves the code in the MessageSource. Returns null if the message could not be resolved.