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.ScriptableBundle objects that can expose various implementations of BundleContext.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 ScriptableBundle objects as named "message-resources" bundles are discovered at runtime and requested by name.

todo: need to implement Serializable here as this ends up in the request


Nested Class Summary
 class BundleMap.ScriptableBundle
          Provide a Map implementation that exposes a BundleContext.BundleNode object to an expression language as a Map.
 
Constructor Summary
BundleMap(HttpServletRequest servletRequest, ServletContext servletContext, BundleContext bundleContext)
          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 name)
           
 BundleContext getBundleContext()
           
 
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
 

Constructor Detail

BundleMap

public BundleMap(HttpServletRequest servletRequest,
                 ServletContext servletContext,
                 BundleContext bundleContext)
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
bundleContext - optional BundleContext object that describes any existing, data bindable resource bundles
Method Detail

getBundleContext

public BundleContext getBundleContext()

get

public Object get(Object name)
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