|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
com.mockrunner.tag.NestedBodyTag
public class NestedBodyTag
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.
| 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)
Adds a dynamic child simulating scriptlets and EL expressions. |
NestedTag |
addTagChild(java.lang.Class tag)
Adds a tag child simulating nested tags. |
NestedTag |
addTagChild(java.lang.Class tag,
java.util.Map attributeMap)
Adds a tag child simulating nested tags. |
NestedTag |
addTagChild(javax.servlet.jsp.tagext.JspTag tag)
Adds a tag child simulating nested tags. |
NestedTag |
addTagChild(javax.servlet.jsp.tagext.JspTag tag,
java.util.Map attributeMap)
Adds a tag child simulating nested tags. |
NestedTag |
addTagChild(javax.servlet.jsp.tagext.TagSupport tag)
Adds a tag child simulating nested tags. |
NestedTag |
addTagChild(javax.servlet.jsp.tagext.TagSupport tag,
java.util.Map attributeMap)
Adds a tag child simulating nested tags. |
void |
addTextChild(java.lang.String text)
Adds a text child simulating static body content. |
int |
doAfterBody()
Delegates to wrapped tag. |
int |
doEndTag()
Delegates to wrapped tag. |
void |
doInitBody()
Delegates to wrapped tag. |
int |
doLifecycle()
Performs the tag lifecycle. |
int |
doStartTag()
Delegates to wrapped tag. |
javax.servlet.jsp.tagext.BodyContent |
getBodyContent()
Delegates to wrapped tag. |
java.lang.Object |
getChild(int index)
Returns a child specified by its index. |
java.util.List |
getChilds()
Returns the List of childs. |
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()
Returns the wrapped tag (the testee). |
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()
Returns the wrapped tag (the testee). |
void |
populateAttributes()
Populates the attributes of the underlying tag. |
void |
release()
Delegates to wrapped tag. |
void |
removeChilds()
Removes all childs. |
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)
Specify if the release method should be called
after processing the tag lifecycle. |
void |
setDoReleaseRecursive(boolean doRelease)
Specify if the release method should be called
after processing the tag lifecycle. |
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 |
|---|
public NestedBodyTag(javax.servlet.jsp.tagext.BodyTag tag,
javax.servlet.jsp.PageContext pageContext)
BodyTagSupport,
the methods that delegate to BodyTagSupport specific methods
throw an exception.
tag - the tagpageContext - the corresponding PageContext
public NestedBodyTag(javax.servlet.jsp.tagext.BodyTag tag,
javax.servlet.jsp.PageContext pageContext,
java.util.Map attributes)
BodyTagSupport,
the methods that delegate to BodyTagSupport specific methods
throw an exception.
tag - the tagpageContext - the corresponding PageContextattributes - the attribute map
public NestedBodyTag(javax.servlet.jsp.tagext.BodyTagSupport tag,
javax.servlet.jsp.PageContext pageContext)
tag - the tagpageContext - the corresponding PageContext
public NestedBodyTag(javax.servlet.jsp.tagext.BodyTagSupport tag,
javax.servlet.jsp.PageContext pageContext,
java.util.Map attributes)
tag - the tagpageContext - the corresponding PageContextattributes - the attribute map| Method Detail |
|---|
public void setDoRelease(boolean doRelease)
NestedTagrelease method should be called
after processing the tag lifecycle. Defaults to false.
It's the container behaviour to call release when the tag
goes back to the pool. It's usually not necessary in the tests
to call this method, because the tag instances are not pooled and
reused during a test run.
This method sets the doRelease flag for this tag but
does not set the flag for child tags.
setDoRelease in interface NestedTagdoRelease - should release be called, default is falsepublic void setDoReleaseRecursive(boolean doRelease)
NestedTagrelease method should be called
after processing the tag lifecycle. Defaults to false.
It's the container behaviour to call release when the tag
goes back to the pool. It's usually not necessary in the tests
to call this method, because the tag instances are not pooled and
reused during a test run.
This method sets the doRelease flag for this
tag and all child tags recursively.
setDoReleaseRecursive in interface NestedTagdoRelease - should release be called, default is falsepublic void populateAttributes()
NestedTag
populateAttributes in interface NestedTag
public int doLifecycle()
throws javax.servlet.jsp.JspException
NestedTagdoBody and doTag
methods are called as in the real web container. The evaluation of the body
is simulated by performing the lifecycle recursively for all childs of the
NestedTag. Calls release on the tag after
processing the tag lifecycle, if doRelease is true
(use NestedTag.setDoRelease(boolean)).
doLifecycle in interface NestedTagdoEndTag call
javax.servlet.jsp.JspExceptionpublic javax.servlet.jsp.tagext.TagSupport getTag()
NestedTag
getTag in interface NestedTagRuntimeException, - if the wrapped tag
is not an instance of TagSupportpublic javax.servlet.jsp.tagext.JspTag getWrappedTag()
NestedTag
getWrappedTag in interface NestedTagpublic void removeChilds()
NestedTag
removeChilds in interface NestedTagpublic java.util.List getChilds()
NestedTagList of childs.
getChilds in interface NestedTagList of childspublic java.lang.Object getChild(int index)
NestedTag
getChild in interface NestedTagindex - the index
public void addTextChild(java.lang.String text)
NestedTag
addTextChild in interface NestedTagtext - the static textpublic void addDynamicChild(DynamicChild child)
NestedTagTagUtil.evalBody(List, Object)
for details about child handling.
addDynamicChild in interface NestedTagchild - the dynamic child instancepublic NestedTag addTagChild(java.lang.Class tag)
NestedTagNestedTag will be created
automatically wrapping the specified tag. An empty attribute
Map will be used for the tag.
addTagChild in interface NestedTagtag - the tag class
public NestedTag addTagChild(java.lang.Class tag,
java.util.Map attributeMap)
NestedTagNestedTag will be created
automatically wrapping the specified tag. The attributes
Map contains the attributes of this tag
(propertyname maps to propertyvalue).
addTagChild in interface NestedTagtag - the tag classattributeMap - the attribute mappublic NestedTag addTagChild(javax.servlet.jsp.tagext.TagSupport tag)
NestedTagNestedTag will be created automatically
wrapping the specified tag. An empty attribute Map
will be used for the tag.
addTagChild in interface NestedTagtag - the tag
public NestedTag addTagChild(javax.servlet.jsp.tagext.TagSupport tag,
java.util.Map attributeMap)
NestedTagNestedTag will be created
automatically wrapping the specified tag. The attributes
Map contains the attributes of this tag
(propertyname maps to propertyvalue).
addTagChild in interface NestedTagtag - the tagattributeMap - the attribute mappublic NestedTag addTagChild(javax.servlet.jsp.tagext.JspTag tag)
NestedTagNestedTag will be created automatically
wrapping the specified tag. An empty attribute Map
will be used for the tag.
addTagChild in interface NestedTagtag - the tag
public NestedTag addTagChild(javax.servlet.jsp.tagext.JspTag tag,
java.util.Map attributeMap)
NestedTagNestedTag will be created
automatically wrapping the specified tag. The attributes
Map contains the attributes of this tag
(propertyname maps to propertyvalue).
addTagChild in interface NestedTagtag - the tagattributeMap - the attribute map
public int doAfterBody()
throws javax.servlet.jsp.JspException
doAfterBody in interface javax.servlet.jsp.tagext.IterationTagdoAfterBody in class javax.servlet.jsp.tagext.BodyTagSupportjavax.servlet.jsp.JspException
public int doEndTag()
throws javax.servlet.jsp.JspException
doEndTag in interface javax.servlet.jsp.tagext.TagdoEndTag in class javax.servlet.jsp.tagext.BodyTagSupportjavax.servlet.jsp.JspException
public int doStartTag()
throws javax.servlet.jsp.JspException
doStartTag in interface javax.servlet.jsp.tagext.TagdoStartTag in class javax.servlet.jsp.tagext.BodyTagSupportjavax.servlet.jsp.JspExceptionpublic java.lang.String getId()
getId in class javax.servlet.jsp.tagext.TagSupportRuntimeException, - if the wrapped tag
is not an instance of TagSupportpublic javax.servlet.jsp.tagext.Tag getParent()
getParent in interface javax.servlet.jsp.tagext.TaggetParent in class javax.servlet.jsp.tagext.TagSupportpublic java.lang.Object getValue(java.lang.String key)
getValue in class javax.servlet.jsp.tagext.TagSupportRuntimeException, - if the wrapped tag
is not an instance of TagSupportpublic java.util.Enumeration getValues()
getValues in class javax.servlet.jsp.tagext.TagSupportRuntimeException, - if the wrapped tag
is not an instance of TagSupportpublic void release()
release in interface javax.servlet.jsp.tagext.Tagrelease in class javax.servlet.jsp.tagext.BodyTagSupportpublic void removeValue(java.lang.String value)
removeValue in class javax.servlet.jsp.tagext.TagSupportRuntimeException, - if the wrapped tag
is not an instance of TagSupportpublic void setId(java.lang.String id)
setId in class javax.servlet.jsp.tagext.TagSupportRuntimeException, - if the wrapped tag
is not an instance of TagSupportpublic void setPageContext(javax.servlet.jsp.PageContext pageContext)
setPageContext
for all child tags.
setPageContext in interface javax.servlet.jsp.tagext.TagsetPageContext in class javax.servlet.jsp.tagext.TagSupportpublic void setParent(javax.servlet.jsp.tagext.Tag parent)
setParent in interface javax.servlet.jsp.tagext.TagsetParent in class javax.servlet.jsp.tagext.TagSupport
public void setValue(java.lang.String key,
java.lang.Object value)
setValue in class javax.servlet.jsp.tagext.TagSupportRuntimeException, - if the wrapped tag
is not an instance of TagSupport
public void doInitBody()
throws javax.servlet.jsp.JspException
doInitBody in interface javax.servlet.jsp.tagext.BodyTagdoInitBody in class javax.servlet.jsp.tagext.BodyTagSupportjavax.servlet.jsp.JspExceptionpublic javax.servlet.jsp.tagext.BodyContent getBodyContent()
getBodyContent in class javax.servlet.jsp.tagext.BodyTagSupportRuntimeException, - if the wrapped tag
is not an instance of BodyTagSupportpublic javax.servlet.jsp.JspWriter getPreviousOut()
getPreviousOut in class javax.servlet.jsp.tagext.BodyTagSupportRuntimeException, - if the wrapped tag
is not an instance of BodyTagSupportpublic void setBodyContent(javax.servlet.jsp.tagext.BodyContent content)
setBodyContent in interface javax.servlet.jsp.tagext.BodyTagsetBodyContent in class javax.servlet.jsp.tagext.BodyTagSupportpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||