站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 2.0.5 API 文档英文版

MessageSourceResourceBundle (Spring Framework API 2.0) - Spring Framework 2.0.5 API 文档英文版

The Spring Framework

org.springframework.context.support
Class MessageSourceResourceBundle

java.lang.Object
  extended by java.util.ResourceBundle
      extended by org.springframework.context.support.MessageSourceResourceBundle

public class MessageSourceResourceBundle
extends ResourceBundle

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

Since:
27.02.2003
Author:
Juergen Hoeller
See Also:
MessageSource, ResourceBundle, JstlUtils.exposeLocalizationContext(javax.servlet.http.HttpServletRequest, org.springframework.context.MessageSource)

Field Summary
 
Fields inherited from class java.util.ResourceBundle
parent
 
Constructor Summary
MessageSourceResourceBundle(MessageSource source, Locale locale)
          Create a new MessageSourceResourceBundle for the given MessageSource and Locale.
 
Method Summary
 Enumeration getKeys()
          This implementation returns null, as a MessageSource does not allow for enumerating the defined message codes.
protected  Object handleGetObject(String code)
          This implementation resolves the code in the MessageSource.
 
Methods inherited from class java.util.ResourceBundle
getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageSourceResourceBundle

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
Method Detail

handleGetObject

protected Object handleGetObject(String code)
This implementation resolves the code in the MessageSource. Returns null if the message could not be resolved.

Specified by:
handleGetObject in class ResourceBundle

getKeys

public Enumeration getKeys()
This implementation returns null, as a MessageSource does not allow for enumerating the defined message codes.

Specified by:
getKeys in class ResourceBundle

The Spring Framework

Copyright © 2002-2007 The Spring Framework.