javawebparts.ajaxparts.taglib.config
Class AjaxEvent

java.lang.Object
  |
  +--javawebparts.ajaxparts.taglib.config.AjaxEvent

public class AjaxEvent
extends java.lang.Object

This class holds configuration information on each event for an Ajax-enabled element that has been defined as implementing Ajax functionality.

Author:
Frank W. Zammetti

Field Summary
private  java.lang.String async
          Flag to determine if this request to be asynchronous or not.
private  java.util.HashMap errorHandlers
          Collection of error handlers for this event.
private  java.lang.String form
          The form this event operates on, if any.
private  boolean frozen
          Flag to determine if the configuration frozen.
private static org.apache.commons.logging.Log log
          Log instance.
private  java.lang.String method
          The HTTP method the request handler for this event will use.
private  java.lang.String postProc
          The postprocessor this event will use.
private  java.lang.String preProc
          The preprocessor this event will use.
private  AjaxRequestHandler requestHandler
          The request handler defined for an event.
private  java.util.ArrayList responseHandlers
          The list of response handlers defined for an event.
private  java.lang.String type
          The type of an event.
 
Constructor Summary
AjaxEvent()
           
 
Method Summary
 void addErrorHandler(AjaxErrorHandler errorHandler)
          Puts an error handler in the collection.
 void addResponseHandler(AjaxResponseHandler inResponseHandler)
          Adds an AjaxResponseHandler instance that will serve as one of the response handlers for this event.
 void freeze()
          Freezes the configuration of this object.
 java.lang.String getAsync()
          Returns whether the request is asynchronous or not.
 AjaxErrorHandler getErrorHandler(java.lang.String inCode)
          Gets an error handler from the collection.
 java.util.HashMap getErrorHandlers()
          Gets the collection of error handlers for this event.
 java.lang.String getForm()
          Returns the form this event operates on.
 java.lang.String getMethod()
          Returns the HTTP method this event's request handler will use.
 java.lang.String getPostProc()
          Accessor for postProc.
 java.lang.String getPreProc()
          Accessor for preProc.
 AjaxRequestHandler getRequestHandler()
          Returns the AjaxRequestHandler instance that serves as the request handler for this event.
 java.util.ArrayList getResponseHandlers()
          Returns the list of AjaxRequestHandler instances that serves as the response handlers for this event.
 java.lang.String getType()
          Returns the type of the event.
 boolean isFrozen()
          Returns true if this onject's config is frozen, false otherwise.
 void setAsync(java.lang.String inAsync)
          Sets whether this request is asynchronous or not.
 void setForm(java.lang.String inForm)
          Sets the form this event operates on.
 void setMethod(java.lang.String inMethod)
          Sets the HTTP method this event's request handler will use.
 void setPostProc(java.lang.String inPostProc)
          Mutator for postProc.
 void setPreProc(java.lang.String inPreProc)
          Mutator for preProc.
 void setRequestHandler(AjaxRequestHandler inRequestHandler)
          Sets the AjaxRequestHandler instance that will serve as the request handler for this event.
 void setType(java.lang.String inType)
          Sets the type of the event.
 java.lang.String toString()
          Overriden toString method.
private  boolean validate()
          This method is called when the object is frozen to ensure it is configured in a legal way.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log
Log instance.


type

private java.lang.String type
The type of an event.


requestHandler

private AjaxRequestHandler requestHandler
The request handler defined for an event.


responseHandlers

private java.util.ArrayList responseHandlers
The list of response handlers defined for an event.


form

private java.lang.String form
The form this event operates on, if any.


method

private java.lang.String method
The HTTP method the request handler for this event will use.


async

private java.lang.String async
Flag to determine if this request to be asynchronous or not. Note: must be a string, rather than the more logical boolean, otherwise overriding wouldn't work properly.


errorHandlers

private java.util.HashMap errorHandlers
Collection of error handlers for this event.


preProc

private java.lang.String preProc
The preprocessor this event will use.


postProc

private java.lang.String postProc
The postprocessor this event will use.


frozen

private boolean frozen
Flag to determine if the configuration frozen.

Constructor Detail

AjaxEvent

public AjaxEvent()
Method Detail

setPreProc

public void setPreProc(java.lang.String inPreProc)
Mutator for preProc.

Parameters:
inPreProc - New value for preProc.

getPreProc

public java.lang.String getPreProc()
Accessor for preProc.

Returns:
Value of preProc.

setPostProc

public void setPostProc(java.lang.String inPostProc)
Mutator for postProc.

Parameters:
inPostProc - New value for postProc.

getPostProc

public java.lang.String getPostProc()
Accessor for postProc.

Returns:
Value of postProc.

setForm

public void setForm(java.lang.String inForm)
Sets the form this event operates on.

Parameters:
inForm - The form this event operates on.

getForm

public java.lang.String getForm()
Returns the form this event operates on.

Returns:
The form this event operates on.

setMethod

public void setMethod(java.lang.String inMethod)
Sets the HTTP method this event's request handler will use.

Parameters:
inMethod - The HTTP method this event's request handler will use.

getMethod

public java.lang.String getMethod()
Returns the HTTP method this event's request handler will use.

Returns:
The HTTP method this event's request handler will use.

setType

public void setType(java.lang.String inType)
Sets the type of the event.

Parameters:
inType - The type of the event

getType

public java.lang.String getType()
Returns the type of the event.

Returns:
The type of the event

setAsync

public void setAsync(java.lang.String inAsync)
Sets whether this request is asynchronous or not.

Parameters:
inAsync - True if request is asynchronous, false if not.

getAsync

public java.lang.String getAsync()
Returns whether the request is asynchronous or not.

Returns:
True if the request is asynchronous, false if not.

setRequestHandler

public void setRequestHandler(AjaxRequestHandler inRequestHandler)
Sets the AjaxRequestHandler instance that will serve as the request handler for this event.

Parameters:
inRequestHandler - AjaxRequestHandler instance

getRequestHandler

public AjaxRequestHandler getRequestHandler()
Returns the AjaxRequestHandler instance that serves as the request handler for this event.

Returns:
AjaxRequestHandler instance

addResponseHandler

public void addResponseHandler(AjaxResponseHandler inResponseHandler)
Adds an AjaxResponseHandler instance that will serve as one of the response handlers for this event.

Parameters:
inResponseHandler - AjaxResponseHandler instance

getResponseHandlers

public java.util.ArrayList getResponseHandlers()
Returns the list of AjaxRequestHandler instances that serves as the response handlers for this event.

Returns:
The list of response handlers.

addErrorHandler

public void addErrorHandler(AjaxErrorHandler errorHandler)
Puts an error handler in the collection.

Parameters:
errorHandler - The error handler to put in the collection.

getErrorHandler

public AjaxErrorHandler getErrorHandler(java.lang.String inCode)
Gets an error handler from the collection.

Parameters:
inCode - The HTTP response code of the error handler to retrieve.
Returns:
The corresponding AjaxErrorHandler.

getErrorHandlers

public java.util.HashMap getErrorHandlers()
Gets the collection of error handlers for this event.

Returns:
The collection of error handlers for this event.

freeze

public void freeze()
Freezes the configuration of this object.


isFrozen

public boolean isFrozen()
Returns true if this onject's config is frozen, false otherwise.

Returns:
True if frozen, false if not.

validate

private boolean validate()
This method is called when the object is frozen to ensure it is configured in a legal way.

Returns:
True if validation passes, false if not.

toString

public java.lang.String toString()
Overriden toString method.

Overrides:
toString in class java.lang.Object
Returns:
A reflexively-built string representation of this bean


Copyright 2005 Frank W. Zammetti