javawebparts.ajaxparts.taglib.config
Class AjaxElement

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

public class AjaxElement
extends java.lang.Object

This class holds configuration information on each element of a form that has been Ajax-enabled.

Author:
Frank W. Zammetti

Field Summary
private  java.lang.String ajaxRef
          Ajax reference ID.
private  java.lang.String async
          Flag to determine if child event requests be asynchronous.
private  java.util.HashMap errorHandlers
          Collection of error handlers for this element.
private  java.util.HashMap events
          The collection of events defined for an element.
private  java.lang.String form
          The name of the form child events 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 events 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
AjaxElement()
           
 
Method Summary
 void addErrorHandler(AjaxErrorHandler errorHandler)
          Puts an error handler in the collection.
 void addEvent(AjaxEvent event)
          Adds an AjaxEvent instance to the collection for the element.
 void freeze()
          Freezes the configuration of this object.
 java.lang.String getAjaxRef()
          Returns the ajaxRef for the element.
 java.lang.String getAsync()
          Accessor for async.
 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 element.
 AjaxEvent getEvent(java.lang.String type)
          Returns the AjaxEvent instance for the named UI event.
 java.util.HashMap getEvents()
          Returns the collection of AjaxEvent instances for this element.
 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)
          Sets the ajaxRef for the element.
 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 events will operate on.


method

private java.lang.String method
The HTTP method child events will use.


async

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


preProc

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


postProc

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


events

private java.util.HashMap events
The collection of events defined for an element.


errorHandlers

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


frozen

private boolean frozen
Flag to determine if the configuration frozen.

Constructor Detail

AjaxElement

public AjaxElement()
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)
Sets the ajaxRef for the element.

Parameters:
inAjaxRef - The ajaxRef top assign to this element

getAjaxRef

public java.lang.String getAjaxRef()
Returns the ajaxRef for the element.

Returns:
The ajaxRef for the element

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.

addEvent

public void addEvent(AjaxEvent event)
Adds an AjaxEvent instance to the collection for the element.

Parameters:
event - The AjaxEvenet instance to add

getEvent

public AjaxEvent getEvent(java.lang.String type)
Returns the AjaxEvent instance for the named UI event.

Parameters:
type - The event type.
Returns:
The AjaxEvent for the names UI event

getEvents

public java.util.HashMap getEvents()
Returns the collection of AjaxEvent instances for this element.

Returns:
The collection of AjaxEvent instances for this element.

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

Returns:
The collection of error handlers for this element.

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