nl.imsystems.atag.tags
Class ATagBase

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by nl.imsystems.atag.tags.ATagBase
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag
Direct Known Subclasses:
ActionTag, ComponentTag, ContainerBase, ParamTag

public class ATagBase
extends BodyTagSupport

Base class for the ATag family of tag handlers.
Provides common support methods to subclasses.

Author:
kayvan

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
ATagBase()
           
 
Method Summary
protected  String getAlias()
          Returns the short name of the refering reference.
protected  ATagContext getATagContext()
          Returns the current ATagContext instance.
protected  String getContextPath()
          Returns web application context path
protected  String getNamingContext()
          Returns the full id of the refering reference.
protected  ContainerBase getParentTag()
          Returns the parent container of this tag.
protected  String getRefererId()
          Returns the full id of the refering reference.
protected  HttpServletRequest getRequest()
          Returns the current HttpServletRequest object
protected  HttpServletResponse getResponse()
          Returns the current HttpServletResponse object
protected  String getTagId()
          Returns full id of the tag by appending the value of id attribute to the namespace derived from the ATag component hierarchy.
protected  void popContext(HttpServletRequest req)
          Puts the previous context on the request scope.
protected  void pushContext(HttpServletRequest req, ATagContext ctx)
          Pushes the given context on the request scope.
protected  String resolveRelativeName(String name)
          Resolves a relative path to a component.
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doEndTag, doInitBody, doStartTag, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Constructor Detail

ATagBase

public ATagBase()
Method Detail

getRequest

protected HttpServletRequest getRequest()
Returns the current HttpServletRequest object

Returns:
The current HttpServletRequest object

getResponse

protected HttpServletResponse getResponse()
Returns the current HttpServletResponse object

Returns:
The current HttpServletResponse object

getContextPath

protected String getContextPath()
Returns web application context path

Returns:
Web application context path

pushContext

protected void pushContext(HttpServletRequest req,
                           ATagContext ctx)
Pushes the given context on the request scope. This method makes a copy of the context currently on the request scope before setting the new context attribute. This copy is reset on the request when popContext is called.

Parameters:
req - The current request
ctx - The context to push

popContext

protected void popContext(HttpServletRequest req)
Puts the previous context on the request scope. This value is copied when push is called and reset by this method.

Parameters:
req - The current request

getATagContext

protected ATagContext getATagContext()
Returns the current ATagContext instance.

Returns:
The current ATagContext

getNamingContext

protected String getNamingContext()
Returns the full id of the refering reference. It is used as a namespace prefix to the id of the current reference, in order to create an absolute path.

Returns:
Full id of the refering reference.

getAlias

protected String getAlias()
Returns the short name of the refering reference. This is the id assigned to the refering reference without its namespace prefix.

Returns:
The short name of the refering reference

getRefererId

protected String getRefererId()
Returns the full id of the refering reference.

Returns:
Full id of the refering reference including namespace.

getTagId

protected String getTagId()
Returns full id of the tag by appending the value of id attribute to the namespace derived from the ATag component hierarchy.

Returns:
The full id of the tag.

getParentTag

protected ContainerBase getParentTag()
Returns the parent container of this tag. This method skips any tags not in the ATag family.

Returns:
The first ATag container.

resolveRelativeName

protected String resolveRelativeName(String name)
Resolves a relative path to a component.

Parameters:
name - The relative name to resolve
Returns:
Absolute id of component.