javawebparts.ajaxparts.taglib.config
Class AjaxRequestHandler

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

public class AjaxRequestHandler
extends java.lang.Object

This class holds configuration information on a request handler defined for a given event of an Ajax-enabled element.

Author:
Frank W. Zammetti

Field Summary
private  boolean frozen
          Flag: Is the configuration frozen?
private  java.lang.String httpMethod
          The HTTP method for a handler.
private  boolean jsonp
          The jsonp parameter to append to the query string, if any.
private static org.apache.commons.logging.Log log
          Log instance.
private  java.lang.String parameter
          The parameter for a handler.
private  java.lang.String target
          The target a handler submits its request to if it is a request handler
private  java.lang.String type
          The type of a handler.
 
Constructor Summary
AjaxRequestHandler()
           
 
Method Summary
 void freeze()
          Freezes the configuration of this object.
 java.lang.String getHttpMethod()
          Returns the HTTP method of this event handler.
 boolean getJsonp()
          Returns the value of the jsonp attribute, or false if not explicitly set.
 java.lang.String getParameter()
          Returns the handler-specific parameter string for this handler.
 java.lang.String getTarget()
          Returns the target (URL) of this handler.
 java.lang.String getType()
          Returns the type of this event handler.
 boolean isFrozen()
          Returns true if this onject's config is frozen, false otherwise.
 void setHttpMethod(java.lang.String inHttpMethod)
          Sets the method of this event handler.
 void setJsonp(boolean inJsonp)
          Sets the jsonp value of this handler.
 void setParameter(java.lang.String inParameter)
          Sets the handler-specific parameter string for this handler.
 void setTarget(java.lang.String inTarget)
          Sets the target (URL) of this handler.
 void setType(java.lang.String inType)
          Sets the type of this event handler.
 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 a handler.


target

private java.lang.String target
The target a handler submits its request to if it is a request handler


parameter

private java.lang.String parameter
The parameter for a handler. Meaning of value is handler-specific.


httpMethod

private java.lang.String httpMethod
The HTTP method for a handler. Either GET or POST (default).


frozen

private boolean frozen
Flag: Is the configuration frozen?


jsonp

private boolean jsonp
The jsonp parameter to append to the query string, if any.

Constructor Detail

AjaxRequestHandler

public AjaxRequestHandler()
Method Detail

setHttpMethod

public void setHttpMethod(java.lang.String inHttpMethod)
Sets the method of this event handler.

Parameters:
inHttpMethod - The HTTP method of this event handler

getHttpMethod

public java.lang.String getHttpMethod()
Returns the HTTP method of this event handler.

Returns:
The HTTP method of this event handler

setType

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

Parameters:
inType - The type of this event handler

getType

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

Returns:
The type of this event handler

setTarget

public void setTarget(java.lang.String inTarget)
Sets the target (URL) of this handler.

Parameters:
inTarget - The URL this handler submits to

getTarget

public java.lang.String getTarget()
Returns the target (URL) of this handler.

Returns:
The URL this handler submits to

setJsonp

public void setJsonp(boolean inJsonp)
Sets the jsonp value of this handler.


getJsonp

public boolean getJsonp()
Returns the value of the jsonp attribute, or false if not explicitly set.

Returns:
Whether the request handler is doing JSON-P or not.

setParameter

public void setParameter(java.lang.String inParameter)
Sets the handler-specific parameter string for this handler.

Parameters:
inParameter - The parameter string for this handler

getParameter

public java.lang.String getParameter()
Returns the handler-specific parameter string for this handler.

Returns:
The parameter string for this handler

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