org.apache.struts.taglib.tiles
Class DefinitionTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--org.apache.struts.taglib.tiles.DefinitionTagSupport
              |
              +--org.apache.struts.taglib.tiles.DefinitionTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.IterationTag, PutListTagParent, PutTagParent, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class DefinitionTag
extends DefinitionTagSupport
implements PutTagParent, PutListTagParent

This is the tag handler for <tiles:definition>, which defines a tiles (or template / component). Definition is put in requested context, and can be used in <tiles:insert>.

Version:
$Revision: 1.3 $ $Date: 2002/10/10 16:32:27 $
Author:
Cedric Dumoulin
See Also:
Serialized Form

Field Summary
private  ComponentDefinition definition
          Template definition
private  java.lang.String extendsDefinition
          Extends attribute value.
private  java.lang.String id
          Definition identifier.
private  java.lang.String scope
          Scope into which definition will be saved.
 
Fields inherited from class org.apache.struts.taglib.tiles.DefinitionTagSupport
controllerName, controllerType, page, role
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
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
DefinitionTag()
           
 
Method Summary
 int doEndTag()
          Process the end tag by puting the definition in appropriate context.
 int doStartTag()
          Process the start tag by creating a new definition.
 java.lang.String getExtends()
          Access method for the extends property.
 java.lang.String getId()
          Access method for the id property.
 java.lang.String getScope()
          Access method for the scope property.
 void processNestedTag(PutListTag nestedTag)
          Process nested ≶putList> tag.
 void processNestedTag(PutTag nestedTag)
          Process nested ≶put> tag.
 void putAttribute(java.lang.String name, java.lang.Object content)
          This method is a convenience for others tags for putting content into the tile definition.
 void release()
          Reset member values for reuse.
protected  void releaseInternal()
          Reset member values for reuse.
 void setExtends(java.lang.String definitionName)
          Sets the value of the extends property.
 void setId(java.lang.String id)
          Sets the value of the id property.
 void setScope(java.lang.String aScope)
          Sets the value of the scope property.
 
Methods inherited from class org.apache.struts.taglib.tiles.DefinitionTagSupport
getControllerName, getControllerType, getPage, getRole, getTemplate, setController, setControllerClass, setControllerName, setControllerType, setControllerUrl, setPage, setRole, setTemplate
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getParent, getValue, getValues, removeValue, 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.IterationTag
 

Field Detail

id

private java.lang.String id
Definition identifier.


scope

private java.lang.String scope
Scope into which definition will be saved.


extendsDefinition

private java.lang.String extendsDefinition
Extends attribute value.


definition

private ComponentDefinition definition
Template definition

Constructor Detail

DefinitionTag

public DefinitionTag()
Method Detail

release

public void release()
Reset member values for reuse. This method calls super.release(), which invokes TagSupport.release(), which typically does nothing.

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

releaseInternal

protected void releaseInternal()
Reset member values for reuse. This method calls super.release(), which invokes TagSupport.release(), which typically does nothing.


putAttribute

public void putAttribute(java.lang.String name,
                         java.lang.Object content)
This method is a convenience for others tags for putting content into the tile definition. Content is already typed by caller.


processNestedTag

public void processNestedTag(PutTag nestedTag)
                      throws javax.servlet.jsp.JspException
Process nested ≶put> tag. Method calls by nested ≶put> tags. Nested list is added to current list. If role is defined, nested attribute is wrapped into an untypped definition containing attribute value and role.

Specified by:
processNestedTag in interface PutTagParent
Parameters:
nestedTag - Nested to process.
javax.servlet.jsp.JspException

processNestedTag

public void processNestedTag(PutListTag nestedTag)
                      throws javax.servlet.jsp.JspException
Process nested ≶putList> tag. Method calls by nested ≶putList> tags. Nested list is added to current list. If role is defined, nested attribute is wrapped into an untypped definition containing attribute value and role.

Specified by:
processNestedTag in interface PutListTagParent
Parameters:
nestedTag - Nested PutTag defining the attribute.
javax.servlet.jsp.JspException

getId

public java.lang.String getId()
Access method for the id property.

Overrides:
getId in class javax.servlet.jsp.tagext.TagSupport
Returns:
the current value of the id property

setId

public void setId(java.lang.String id)
Sets the value of the id property.

Overrides:
setId in class javax.servlet.jsp.tagext.TagSupport

getScope

public java.lang.String getScope()
Access method for the scope property.

Returns:
the current value of the scope property

setScope

public void setScope(java.lang.String aScope)
Sets the value of the scope property.

Parameters:
aScope - the new value of the scope property

setExtends

public void setExtends(java.lang.String definitionName)
Sets the value of the extends property.

Parameters:
definitionName - Name of parent definition.

getExtends

public java.lang.String getExtends()
Access method for the extends property.

Returns:
the current value of the extends property

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Process the start tag by creating a new definition.

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

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Process the end tag by puting the definition in appropriate context.

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


Copyright 2000-2002 - Cedric Dumoulin and Apache Software Foundation