com.mockrunner.tag
Class NestedBodyTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.tagext.BodyTagSupport
          extended bycom.mockrunner.tag.NestedBodyTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, NestedTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class NestedBodyTag
extends javax.servlet.jsp.tagext.BodyTagSupport
implements NestedTag

Implementation of NestedTag wrapping tags of type BodyTag. NestedBodyTag instances are created with the help of TagTestModule.createNestedTag(java.lang.Class). You do not need to create them on your own in the tests.

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
 
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
NestedBodyTag(javax.servlet.jsp.tagext.BodyTag tag, javax.servlet.jsp.PageContext pageContext)
          Constructor for a tag with an empty attribute map.
NestedBodyTag(javax.servlet.jsp.tagext.BodyTag tag, javax.servlet.jsp.PageContext pageContext, java.util.Map attributes)
          Constructor for a tag with the specified attribute map.
NestedBodyTag(javax.servlet.jsp.tagext.BodyTagSupport tag, javax.servlet.jsp.PageContext pageContext)
          Constructor for a tag with an empty attribute map.
NestedBodyTag(javax.servlet.jsp.tagext.BodyTagSupport tag, javax.servlet.jsp.PageContext pageContext, java.util.Map attributes)
          Constructor for a tag with the specified attribute map.
 
Method Summary
 void addDynamicChild(DynamicChild child)
          Implementation of NestedTag.addDynamicChild(com.mockrunner.tag.DynamicChild).
 NestedTag addTagChild(java.lang.Class tag)
          Implementation of NestedTag.addTagChild(Class).
 NestedTag addTagChild(java.lang.Class tag, java.util.Map attributeMap)
          Implementation of NestedTag.addTagChild(Class, Map).
 NestedTag addTagChild(javax.servlet.jsp.tagext.JspTag tag)
          Implementation of NestedTag.addTagChild(JspTag).
 NestedTag addTagChild(javax.servlet.jsp.tagext.JspTag tag, java.util.Map attributeMap)
          Implementation of NestedTag.addTagChild(JspTag, Map).
 NestedTag addTagChild(javax.servlet.jsp.tagext.TagSupport tag)
          Implementation of NestedTag.addTagChild(TagSupport).
 NestedTag addTagChild(javax.servlet.jsp.tagext.TagSupport tag, java.util.Map attributeMap)
          Implementation of NestedTag.addTagChild(TagSupport, Map).
 void addTextChild(java.lang.String text)
          Implementation of NestedTag.addTextChild(java.lang.String).
 int doAfterBody()
          Delegates to wrapped tag.
 int doEndTag()
          Delegates to wrapped tag.
 void doInitBody()
          Delegates to wrapped tag.
 int doLifecycle()
          Implementation of NestedTag.doLifecycle() for body tags.
 int doStartTag()
          Delegates to wrapped tag.
 javax.servlet.jsp.tagext.BodyContent getBodyContent()
          Delegates to wrapped tag.
 java.lang.Object getChild(int index)
          Implementation of NestedTag.getChild(int).
 java.util.List getChilds()
          Implementation of NestedTag.getChilds().
 java.lang.String getId()
          Delegates to wrapped tag.
 javax.servlet.jsp.tagext.Tag getParent()
          Delegates to wrapped tag.
 javax.servlet.jsp.JspWriter getPreviousOut()
          Delegates to wrapped tag.
 javax.servlet.jsp.tagext.TagSupport getTag()
          Implementation of NestedTag.getTag().
 java.lang.Object getValue(java.lang.String key)
          Delegates to wrapped tag.
 java.util.Enumeration getValues()
          Delegates to wrapped tag.
 javax.servlet.jsp.tagext.JspTag getWrappedTag()
          Implementation of NestedTag.getWrappedTag().
 void populateAttributes()
          Implementation of NestedTag.populateAttributes().
 void release()
          Delegates to wrapped tag.
 void removeChilds()
          Implementation of NestedTag.removeChilds().
 void removeValue(java.lang.String value)
          Delegates to wrapped tag.
 void setBodyContent(javax.servlet.jsp.tagext.BodyContent content)
          Delegates to wrapped tag.
 void setDoRelease(boolean doRelease)
          Implementation of NestedTag.setDoRelease(boolean).
 void setDoReleaseRecursive(boolean doRelease)
          Implementation of NestedTag.setDoReleaseRecursive(boolean).
 void setId(java.lang.String id)
          Delegates to wrapped tag.
 void setPageContext(javax.servlet.jsp.PageContext pageContext)
          Delegates to wrapped tag.
 void setParent(javax.servlet.jsp.tagext.Tag parent)
          Delegates to wrapped tag.
 void setValue(java.lang.String key, java.lang.Object value)
          Delegates to wrapped tag.
 java.lang.String toString()
          Dumps the content of this and the nested tags.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NestedBodyTag

public NestedBodyTag(javax.servlet.jsp.tagext.BodyTag tag,
                     javax.servlet.jsp.PageContext pageContext)
Constructor for a tag with an empty attribute map. If the specified tag is not an instance of BodyTagSupport, the methods that delegate to BodyTagSupport specific methods throw an exception.

Parameters:
tag - the tag
pageContext - the corresponding PageContext

NestedBodyTag

public NestedBodyTag(javax.servlet.jsp.tagext.BodyTag tag,
                     javax.servlet.jsp.PageContext pageContext,
                     java.util.Map attributes)
Constructor for a tag with the specified attribute map. If the specified tag is not an instance of BodyTagSupport, the methods that delegate to BodyTagSupport specific methods throw an exception.

Parameters:
tag - the tag
pageContext - the corresponding PageContext
attributes - the attribute map

NestedBodyTag

public NestedBodyTag(javax.servlet.jsp.tagext.BodyTagSupport tag,
                     javax.servlet.jsp.PageContext pageContext)
Constructor for a tag with an empty attribute map.

Parameters:
tag - the tag
pageContext - the corresponding PageContext

NestedBodyTag

public NestedBodyTag(javax.servlet.jsp.tagext.BodyTagSupport tag,
                     javax.servlet.jsp.PageContext pageContext,
                     java.util.Map attributes)
Constructor for a tag with the specified attribute map.

Parameters:
tag - the tag
pageContext - the corresponding PageContext
attributes - the attribute map
Method Detail

setDoRelease

public void setDoRelease(boolean doRelease)
Implementation of NestedTag.setDoRelease(boolean).

Specified by:
setDoRelease in interface NestedTag
Parameters:
doRelease - should release be called, default is false

setDoReleaseRecursive

public void setDoReleaseRecursive(boolean doRelease)
Implementation of NestedTag.setDoReleaseRecursive(boolean).

Specified by:
setDoReleaseRecursive in interface NestedTag
Parameters:
doRelease - should release be called, default is false

populateAttributes

public void populateAttributes()
Implementation of NestedTag.populateAttributes().

Specified by:
populateAttributes in interface NestedTag

doLifecycle

public int doLifecycle()
                throws javax.servlet.jsp.JspException
Implementation of NestedTag.doLifecycle() for body tags.

Specified by:
doLifecycle in interface NestedTag
Returns:
the result of the final doEndTag call
Throws:
javax.servlet.jsp.JspException

getTag

public javax.servlet.jsp.tagext.TagSupport getTag()
Implementation of NestedTag.getTag().

Specified by:
getTag in interface NestedTag
Returns:
the wrapped tag
Throws:
RuntimeException, - if the wrapped tag is not an instance of TagSupport

getWrappedTag

public javax.servlet.jsp.tagext.JspTag getWrappedTag()
Implementation of NestedTag.getWrappedTag().

Specified by:
getWrappedTag in interface NestedTag
Returns:
the wrapped tag

removeChilds

public void removeChilds()
Implementation of NestedTag.removeChilds().

Specified by:
removeChilds in interface NestedTag

getChilds

public java.util.List getChilds()
Implementation of NestedTag.getChilds().

Specified by:
getChilds in interface NestedTag
Returns:
the List of childs

getChild

public java.lang.Object getChild(int index)
Implementation of NestedTag.getChild(int).

Specified by:
getChild in interface NestedTag
Parameters:
index - the index
Returns:
the child

addTextChild

public void addTextChild(java.lang.String text)
Implementation of NestedTag.addTextChild(java.lang.String).

Specified by:
addTextChild in interface NestedTag
Parameters:
text - the static text

addDynamicChild

public void addDynamicChild(DynamicChild child)
Implementation of NestedTag.addDynamicChild(com.mockrunner.tag.DynamicChild).

Specified by:
addDynamicChild in interface NestedTag
Parameters:
child - the dynamic child instance

addTagChild

public NestedTag addTagChild(java.lang.Class tag)
Implementation of NestedTag.addTagChild(Class).

Specified by:
addTagChild in interface NestedTag
Parameters:
tag - the tag class

addTagChild

public NestedTag addTagChild(java.lang.Class tag,
                             java.util.Map attributeMap)
Implementation of NestedTag.addTagChild(Class, Map).

Specified by:
addTagChild in interface NestedTag
Parameters:
tag - the tag class
attributeMap - the attribute map

addTagChild

public NestedTag addTagChild(javax.servlet.jsp.tagext.TagSupport tag)
Implementation of NestedTag.addTagChild(TagSupport).

Specified by:
addTagChild in interface NestedTag
Parameters:
tag - the tag

addTagChild

public NestedTag addTagChild(javax.servlet.jsp.tagext.TagSupport tag,
                             java.util.Map attributeMap)
Implementation of NestedTag.addTagChild(TagSupport, Map).

Specified by:
addTagChild in interface NestedTag
Parameters:
tag - the tag
attributeMap - the attribute map

addTagChild

public NestedTag addTagChild(javax.servlet.jsp.tagext.JspTag tag)
Implementation of NestedTag.addTagChild(JspTag).

Specified by:
addTagChild in interface NestedTag
Parameters:
tag - the tag

addTagChild

public NestedTag addTagChild(javax.servlet.jsp.tagext.JspTag tag,
                             java.util.Map attributeMap)
Implementation of NestedTag.addTagChild(JspTag, Map).

Specified by:
addTagChild in interface NestedTag
Parameters:
tag - the tag
attributeMap - the attribute map

doAfterBody

public int doAfterBody()
                throws javax.servlet.jsp.JspException
Delegates to wrapped tag.

Specified by:
doAfterBody in interface javax.servlet.jsp.tagext.IterationTag
Throws:
javax.servlet.jsp.JspException

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Delegates to wrapped tag.

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Throws:
javax.servlet.jsp.JspException

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Delegates to wrapped tag.

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

getId

public java.lang.String getId()
Delegates to wrapped tag.

Throws:
RuntimeException, - if the wrapped tag is not an instance of TagSupport

getParent

public javax.servlet.jsp.tagext.Tag getParent()
Delegates to wrapped tag.

Specified by:
getParent in interface javax.servlet.jsp.tagext.Tag

getValue

public java.lang.Object getValue(java.lang.String key)
Delegates to wrapped tag.

Throws:
RuntimeException, - if the wrapped tag is not an instance of TagSupport

getValues

public java.util.Enumeration getValues()
Delegates to wrapped tag.

Throws:
RuntimeException, - if the wrapped tag is not an instance of TagSupport

release

public void release()
Delegates to wrapped tag.

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

removeValue

public void removeValue(java.lang.String value)
Delegates to wrapped tag.

Throws:
RuntimeException, - if the wrapped tag is not an instance of TagSupport

setId

public void setId(java.lang.String id)
Delegates to wrapped tag.

Throws:
RuntimeException, - if the wrapped tag is not an instance of TagSupport

setPageContext

public void setPageContext(javax.servlet.jsp.PageContext pageContext)
Delegates to wrapped tag. Also calls setPageContext for all child tags.

Specified by:
setPageContext in interface javax.servlet.jsp.tagext.Tag

setParent

public void setParent(javax.servlet.jsp.tagext.Tag parent)
Delegates to wrapped tag.

Specified by:
setParent in interface javax.servlet.jsp.tagext.Tag

setValue

public void setValue(java.lang.String key,
                     java.lang.Object value)
Delegates to wrapped tag.

Throws:
RuntimeException, - if the wrapped tag is not an instance of TagSupport

doInitBody

public void doInitBody()
                throws javax.servlet.jsp.JspException
Delegates to wrapped tag.

Specified by:
doInitBody in interface javax.servlet.jsp.tagext.BodyTag
Throws:
javax.servlet.jsp.JspException

getBodyContent

public javax.servlet.jsp.tagext.BodyContent getBodyContent()
Delegates to wrapped tag.

Throws:
RuntimeException, - if the wrapped tag is not an instance of BodyTagSupport

getPreviousOut

public javax.servlet.jsp.JspWriter getPreviousOut()
Delegates to wrapped tag.

Throws:
RuntimeException, - if the wrapped tag is not an instance of BodyTagSupport

setBodyContent

public void setBodyContent(javax.servlet.jsp.tagext.BodyContent content)
Delegates to wrapped tag.

Specified by:
setBodyContent in interface javax.servlet.jsp.tagext.BodyTag

toString

public java.lang.String toString()
Dumps the content of this and the nested tags.