org.apache.beehive.netui.script.common
Class BundleMap

Object
  extended by AbstractMap
      extended by AbstractScriptableMap
          extended by BundleMap
All Implemented Interfaces:
Map

public class BundleMap
extends AbstractScriptableMap

Provide a Map of BundleMap.BundleNodeMap objects that can expose various implementations of BundleNode to expression languages.

This Map implementation is optimized for read as the entrySet() is created lazily. In addition, the entrySet does not contain all possible BundleNodeMap objects as named "message-resources" bundles are discovered at runtime and requested by name.


Field Summary
static String DEFAULT_STRUTS_BUNDLE_NAME
           
 
Constructor Summary
BundleMap(HttpServletRequest servletRequest, ServletContext servletContext)
          Create a BundleMap object that is used for data binding to resource bundles.
 
Method Summary
 boolean containsKey(Object key)
          Implementation of Map.containsKey for the bundle implicit object.
 Set entrySet()
           
 Object get(Object key)
           
 void registerResourceBundle(String name, String resourcePath, Locale forcedLocale)
           
 
Methods inherited from class AbstractMap
clear, clone, containsValue, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values
 
Methods inherited from class Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_STRUTS_BUNDLE_NAME

public static final String DEFAULT_STRUTS_BUNDLE_NAME
See Also:
Constant Field Values
Constructor Detail

BundleMap

public BundleMap(HttpServletRequest servletRequest,
                 ServletContext servletContext)
Create a BundleMap object that is used for data binding to resource bundles.

Parameters:
servletRequest - the current HttpServletRequest object
servletContext - a ServletContext object that facilitates binding to resource bundles declared in Struts modules
Method Detail

registerResourceBundle

public void registerResourceBundle(String name,
                                   String resourcePath,
                                   Locale forcedLocale)

get

public Object get(Object key)
Specified by:
get in interface Map
Overrides:
get in class AbstractMap

containsKey

public boolean containsKey(Object key)
Implementation of Map.containsKey for the bundle implicit object. This method is required by JSP 2.0 EL and performs the lookups of the various available bundles which have been registered either explicitly or implicitly.

Specified by:
containsKey in interface Map
Overrides:
containsKey in class AbstractMap
Parameters:
key - The name of a bundle to lookup
Returns:
true if the bundle is available; false otherwise

entrySet

public Set entrySet()
Specified by:
entrySet in interface Map
Specified by:
entrySet in class AbstractMap