com.bristle.javalib.jsp
Class InvokableMethodViaMap

java.lang.Object
  extended by java.util.AbstractMap
      extended by java.util.HashMap
          extended by com.bristle.javalib.jsp.InvokableMethodViaMap
All Implemented Interfaces:
Serializable, Cloneable, Map

public abstract class InvokableMethodViaMap
extends HashMap

This abstract class supports the ability for an arbitrary one-parameter Java method to be invoked via a JSP EL expression, by presenting the method as a map. Subclasses must override the get() method with an implementation that invokes the desired Java method.

Usage:

   - The typical scenario for using this class is:
     1. Subclass it with a class that overrides get() to call the Java method.
     2. Invoke the subclass from a JSP page, as:
           
           <jsp:useBean id='myBean' 
                        class='mySubclass' 
           />
           
           ${myBean.myParameterValue}
           ${myBean[myELVariableHoldingTheParameterValue]}

Assumptions:
Effects:
       - None.
Anticipated Changes:
Notes:
Implementation Notes:
   - Extends HashMap, not extends AbstractMap or implements Map, so that 
     subclasses are required to implement only the get() method, not all 
     methods.
Portability Issues:
Revision History:
   $Log$

See Also:
Serialized Form

Constructor Summary
InvokableMethodViaMap()
           
 
Method Summary
abstract  Object get(Object arg0)
          Overridden methods to fake a Map with all possible keys valid.
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

InvokableMethodViaMap

public InvokableMethodViaMap()
Method Detail

get

public abstract Object get(Object arg0)
Overridden methods to fake a Map with all possible keys valid.

Specified by:
get in interface Map
Overrides:
get in class HashMap