org.apache.tiles.jsp.taglib
Class AttributeTagSupport

Package class diagram package AttributeTagSupport
java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.apache.tiles.jsp.taglib.AttributeTagSupport
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
ImportAttributeTag, UseAttributeTag

public abstract class AttributeTagSupport
extends javax.servlet.jsp.tagext.TagSupport

Support for Scoped tags.

See Also:
Serialized Form

Field Summary
protected  org.apache.tiles.Attribute attribute
          The found attribute.
protected  org.apache.tiles.AttributeContext attributeContext
          The current attribute context.
protected  org.apache.tiles.TilesContainer container
          The Tiles container to use.
protected  boolean ignore
          Flag that, if true, ignores exceptions.
protected  java.lang.String name
          The name of the attribute.
protected  int scope
          The scope.
protected  java.lang.String scopeName
          The scope name.
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
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
AttributeTagSupport()
           
 
Method Summary
 int doEndTag()
          
 int doStartTag()
          
abstract  void execute()
          Execute this tag.
 boolean getIgnore()
          Get ignore flag.
 java.lang.String getName()
          Get the name.
 java.lang.String getScope()
          Get scope.
static int getScope(java.lang.String scopeName)
          Converts the scope name into its corresponding PageContext constant value.
 int getScopeId()
          Get scope value from string value.
 void release()
          
 void setIgnore(boolean ignore)
          Set ignore flag.
 void setName(java.lang.String name)
          Set the name.
 void setScope(java.lang.String scope)
          Set the scope.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, 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
 

Field Detail

scopeName

protected java.lang.String scopeName
The scope name.


scope

protected int scope
The scope.


name

protected java.lang.String name
The name of the attribute.


ignore

protected boolean ignore
Flag that, if true, ignores exceptions.


container

protected org.apache.tiles.TilesContainer container
The Tiles container to use.


attributeContext

protected org.apache.tiles.AttributeContext attributeContext
The current attribute context.


attribute

protected org.apache.tiles.Attribute attribute
The found attribute.

Constructor Detail

AttributeTagSupport

public AttributeTagSupport()
Method Detail

setScope

public void setScope(java.lang.String scope)
Set the scope.

Parameters:
scope - Scope.

getScope

public java.lang.String getScope()
Get scope.

Returns:
Scope.

release

public void release()

Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class javax.servlet.jsp.tagext.TagSupport

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException

execute

public abstract void execute()
                      throws javax.servlet.jsp.JspException,
                             java.io.IOException
Execute this tag. It is called inside doEndTag().

Throws:
javax.servlet.jsp.JspException - If something goes wrong during rendering.
java.io.IOException - If something goes wrong during writing content.

doEndTag

public int doEndTag()

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport

getScopeId

public int getScopeId()
               throws javax.servlet.jsp.JspException
Get scope value from string value.

Returns:
Scope as an int, or defaultValue if scope is null.
Throws:
javax.servlet.jsp.JspException - Scope name is not recognized as a valid scope.

getScope

public static int getScope(java.lang.String scopeName)
                    throws javax.servlet.jsp.JspException
Converts the scope name into its corresponding PageContext constant value.

Parameters:
scopeName - Can be "page", "request", "session", or "application" in any case.
Returns:
The constant representing the scope (ie. PageContext.REQUEST_SCOPE).
Throws:
javax.servlet.jsp.JspException - if the scopeName is not a valid name.

getName

public java.lang.String getName()
Get the name.

Returns:
Name.

setName

public void setName(java.lang.String name)
Set the name.

Parameters:
name - The new name

setIgnore

public void setIgnore(boolean ignore)
Set ignore flag.

Parameters:
ignore - default: false: Exception is thrown when attribute is not found, set to true to ignore missing attributes silently

getIgnore

public boolean getIgnore()
Get ignore flag.

Returns:
default: false: Exception is thrown when attribute is not found, set to true to ignore missing attributes silently