javawebparts.ajaxparts.taglib.config
Class AjaxGroup

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

public class AjaxGroup
extends java.lang.Object

This class holds configuration information on each group of elements (usually a group corresponds to a page, but it doesn't have to) that contains Ajax-enabled elements.

Author:
Frank W. Zammetti

Field Summary
private  java.lang.String ajaxRef
          Ajax reference ID.
private  java.lang.String async
          Flag to determine if child element requests be asynchronous.
private  java.util.HashMap elements
          Elements defined for this form.
private  java.util.HashMap errorHandlers
          Collection of error handlers for this group.
private  java.lang.String form
          The name of the form child elements will operate on.
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 child elements will use.
private  java.lang.String postProc
          The postprocessor this event will use.
private  java.lang.String preProc
          The preprocessor this event will use.
 
Constructor Summary
AjaxGroup()
           
 
Method Summary
 void addElement(AjaxElement element)
          Puts an element in the collection.
 void addErrorHandler(AjaxErrorHandler errorHandler)
          Puts an error handler in the collection.
 void freeze()
          Freezes the configuration of this object.
 java.lang.String getAjaxRef()
          ajaxRef getter.
 java.lang.String getAsync()
          Accessor for async.
 AjaxElement getElement(java.lang.String inAjaxRef)
          Gets an element from the collection.
 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 group.
 java.lang.String getForm()
          Accessor for form.
 java.lang.String getMethod()
          Accessor for method.
 java.lang.String getPostProc()
          Accessor for postProc.
 java.lang.String getPreProc()
          Accessor for preProc.
 boolean isFrozen()
          Returns true if this onject's config is frozen, false otherwise.
 void setAjaxRef(java.lang.String inAjaxRef)
          ajaxRef setter.
 void setAsync(java.lang.String inAsync)
          Mutator for async.
 void setForm(java.lang.String inForm)
          Mutator for form.
 void setMethod(java.lang.String inMethod)
          Mutator for method.
 void setPostProc(java.lang.String inPostProc)
          Mutator for postProc.
 void setPreProc(java.lang.String inPreProc)
          Mutator for preProc.
 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.


ajaxRef

private java.lang.String ajaxRef
Ajax reference ID.


form

private java.lang.String form
The name of the form child elements will operate on. Defaults to "parent".


method

private java.lang.String method
The HTTP method child elements will use. Defaults to "post".


async

private java.lang.String async
Flag to determine if child element requests be asynchronous. Note: must be a string, rather than the more logical boolean, otherwise overriding wouldn't work properly. Defaults to "true".


elements

private java.util.HashMap elements
Elements defined for this form.


preProc

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


postProc

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


errorHandlers

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


frozen

private boolean frozen
Flag to determine if the configuration frozen.

Constructor Detail

AjaxGroup

public AjaxGroup()
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.

setAjaxRef

public void setAjaxRef(java.lang.String inAjaxRef)
ajaxRef setter.

Parameters:
inAjaxRef - ajaxRef.

getAjaxRef

public java.lang.String getAjaxRef()
ajaxRef getter.

Returns:
The ajaxRef.

setForm

public void setForm(java.lang.String inForm)
Mutator for form.

Parameters:
inForm - New value for form.

getForm

public java.lang.String getForm()
Accessor for form.

Returns:
Value of form.

setMethod

public void setMethod(java.lang.String inMethod)
Mutator for method.

Parameters:
inMethod - New value for method.

getMethod

public java.lang.String getMethod()
Accessor for method.

Returns:
Value of method.

setAsync

public void setAsync(java.lang.String inAsync)
Mutator for async.

Parameters:
inAsync - New value for async.

getAsync

public java.lang.String getAsync()
Accessor for async.

Returns:
Value of async.

addElement

public void addElement(AjaxElement element)
Puts an element in the collection.

Parameters:
element - The element to put in the collection.

getElement

public AjaxElement getElement(java.lang.String inAjaxRef)
Gets an element from the collection.

Parameters:
inAjaxRef - The ajaxRef of the element to retrieve.
Returns:
The corresponding AjaxElement.

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 group.

Returns:
The collection of error handlers for this group.

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