com.sun.rave.web.ui.component.util.event
Class HandlerDefinition

java.lang.Object
  extended by com.sun.rave.web.ui.component.util.event.HandlerDefinition
All Implemented Interfaces:
java.io.Serializable

public class HandlerDefinition
extends java.lang.Object
implements java.io.Serializable

A HandlerDefinition defines a "handler" that may be invoked in the process of executing an event. A HandlerDefinition has an id, java method, input definitions, output definitions, and child handlers.

The java method to be invoked must have the following method signature:

public void beginDisplay(HandlerContext handlerCtx)

void above can return a value. Depending on the type of event, return values may be handled differently.

See Also:
Serialized Form

Field Summary
static java.lang.Class[] EVENT_ARGS
           
 
Constructor Summary
HandlerDefinition(java.lang.String id)
          Constructor
 
Method Summary
 void addChildHandler(Handler desc)
          This method adds a Handler to the list of child handlers.
 void addInputDef(IODescriptor desc)
          This method adds an IODescriptor to the list of input descriptors.
 void addOutputDef(IODescriptor desc)
          This method adds an IODescriptor to the list of output descriptors.
 java.util.List getChildHandlers()
          This method retrieves the List of child Handler.
 java.lang.String getDescription()
          For future tool support
 java.lang.reflect.Method getHandlerMethod()
           
 java.lang.String getId()
          This method returns the id for this handler.
 IODescriptor getInputDef(java.lang.String name)
          This method returns the requested IODescriptor, null if not found.
 java.util.Map getInputDefs()
          This method retrieves the Map of input IODescriptors.
 IODescriptor getOutputDef(java.lang.String name)
          This method returns the requested IODescriptor, null if not found.
 java.util.Map getOutputDefs()
          This method retrieves the Map of output IODescriptors.
 boolean isStatic()
           This method determines if the handler is static.
 void setChildHandlers(java.util.List childHandlers)
          This method sets the List of child Handlers for this HandlerDefinition.
 void setDescription(java.lang.String desc)
          For future tool support
 void setHandlerMethod(java.lang.reflect.Method method)
           
 void setHandlerMethod(java.lang.String cls, java.lang.String methodName)
           This method sets the event handler (method) to be invoked.
 void setInputDefs(java.util.Map inputDefs)
          This method sets the input IODescriptors for this handler.
 void setOutputDefs(java.util.Map outputDefs)
          This method sets the output IODescriptors for this handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT_ARGS

public static final java.lang.Class[] EVENT_ARGS
Constructor Detail

HandlerDefinition

public HandlerDefinition(java.lang.String id)
Constructor

Method Detail

getId

public java.lang.String getId()
This method returns the id for this handler.


getDescription

public java.lang.String getDescription()
For future tool support


setDescription

public void setDescription(java.lang.String desc)
For future tool support


setHandlerMethod

public void setHandlerMethod(java.lang.String cls,
                             java.lang.String methodName)

This method sets the event handler (method) to be invoked. The method should be public and accept a prameter of type "HandlerContext" Example:

public void beginDisplay(HandlerContext handlerCtx)

Parameters:
cls - The full class name containing method
methodName - The method name of the handler within class

setHandlerMethod

public void setHandlerMethod(java.lang.reflect.Method method)

isStatic

public boolean isStatic()

This method determines if the handler is static.


getHandlerMethod

public java.lang.reflect.Method getHandlerMethod()

addInputDef

public void addInputDef(IODescriptor desc)
This method adds an IODescriptor to the list of input descriptors. These descriptors define the input parameters to this handler.

Parameters:
desc - The input IODescriptor to add

setInputDefs

public void setInputDefs(java.util.Map inputDefs)
This method sets the input IODescriptors for this handler.

Parameters:
inputDefs - The Map of IODescriptors

getInputDefs

public java.util.Map getInputDefs()
This method retrieves the Map of input IODescriptors.

Returns:
The Map of IODescriptors

getInputDef

public IODescriptor getInputDef(java.lang.String name)
This method returns the requested IODescriptor, null if not found.


addOutputDef

public void addOutputDef(IODescriptor desc)
This method adds an IODescriptor to the list of output descriptors. These descriptors define the output parameters to this handler.

Parameters:
desc - The IODescriptor to add

setOutputDefs

public void setOutputDefs(java.util.Map outputDefs)
This method sets the output IODescriptors for this handler.

Parameters:
outputDefs - The Map of output IODescriptors

getOutputDefs

public java.util.Map getOutputDefs()
This method retrieves the Map of output IODescriptors.

Returns:
The Map of output IODescriptors

getOutputDef

public IODescriptor getOutputDef(java.lang.String name)
This method returns the requested IODescriptor, null if not found.


addChildHandler

public void addChildHandler(Handler desc)
This method adds a Handler to the list of child handlers. Child Handlers are executed PRIOR to this handler executing.

Parameters:
desc - The Handler to add

setChildHandlers

public void setChildHandlers(java.util.List childHandlers)
This method sets the List of child Handlers for this HandlerDefinition.

Parameters:
childHandlers - The List of child Handler objects

getChildHandlers

public java.util.List getChildHandlers()
This method retrieves the List of child Handler.

Returns:
The List of child Handler for this handler.