|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.jsp.tagext.SimpleTagSupport com.mockrunner.tag.NestedSimpleTag
public class NestedSimpleTag
Implementation of NestedTag
wrapping tags of
type SimpleTag
. NestedSimpleTag
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.
Constructor Summary | |
---|---|
NestedSimpleTag(javax.servlet.jsp.tagext.SimpleTag tag,
javax.servlet.jsp.JspContext jspContext)
Constructor for a tag with an empty attribute map. |
|
NestedSimpleTag(javax.servlet.jsp.tagext.SimpleTag tag,
javax.servlet.jsp.JspContext jspContext,
java.util.Map attributes)
Constructor for a tag with the specified attribute map. |
|
NestedSimpleTag(javax.servlet.jsp.tagext.SimpleTagSupport tag,
javax.servlet.jsp.JspContext jspContext)
Constructor for a tag with an empty attribute map. |
|
NestedSimpleTag(javax.servlet.jsp.tagext.SimpleTagSupport tag,
javax.servlet.jsp.JspContext jspContext,
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 |
doLifecycle()
Implementation of NestedTag.doLifecycle() for simple
tags. |
void |
doTag()
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. |
javax.servlet.jsp.tagext.JspFragment |
getJspBody()
Returns the body fragment. |
javax.servlet.jsp.JspContext |
getJspContext()
Returns the JspContext . |
javax.servlet.jsp.tagext.JspTag |
getParent()
Delegates to wrapped tag. |
javax.servlet.jsp.tagext.TagSupport |
getTag()
Implementation of NestedTag.getTag() . |
javax.servlet.jsp.tagext.JspTag |
getWrappedTag()
Returns the wrapped tag (the testee). |
void |
populateAttributes()
Populates the attributes of the underlying tag. |
void |
removeChilds()
Removes all childs. |
void |
setDoRelease(boolean doRelease)
Implementation of NestedTag.setDoRelease(boolean) . |
void |
setDoReleaseRecursive(boolean doRelease)
Implementation of NestedTag.setDoReleaseRecursive(boolean) . |
void |
setJspBody(javax.servlet.jsp.tagext.JspFragment jspBody)
Delegates to wrapped tag. |
void |
setJspContext(javax.servlet.jsp.JspContext jspContext)
Delegates to wrapped tag. |
void |
setParent(javax.servlet.jsp.tagext.JspTag parent)
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.SimpleTagSupport |
---|
findAncestorWithClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NestedSimpleTag(javax.servlet.jsp.tagext.SimpleTag tag, javax.servlet.jsp.JspContext jspContext)
tag
- the tagjspContext
- the corresponding JspContext
public NestedSimpleTag(javax.servlet.jsp.tagext.SimpleTag tag, javax.servlet.jsp.JspContext jspContext, java.util.Map attributes)
tag
- the tagjspContext
- the corresponding JspContext
attributes
- the attribute mappublic NestedSimpleTag(javax.servlet.jsp.tagext.SimpleTagSupport tag, javax.servlet.jsp.JspContext jspContext)
tag
- the tagjspContext
- the corresponding JspContext
public NestedSimpleTag(javax.servlet.jsp.tagext.SimpleTagSupport tag, javax.servlet.jsp.JspContext jspContext, java.util.Map attributes)
tag
- the tagjspContext
- the corresponding JspContext
attributes
- the attribute mapMethod Detail |
---|
public void setDoRelease(boolean doRelease)
NestedTag.setDoRelease(boolean)
.
Does nothing in this case.
setDoRelease
in interface NestedTag
doRelease
- should release be called, default is false
public void setDoReleaseRecursive(boolean doRelease)
NestedTag.setDoReleaseRecursive(boolean)
.
Does nothing in this case.
setDoReleaseRecursive
in interface NestedTag
doRelease
- should release be called, default is false
public void populateAttributes()
NestedTag
populateAttributes
in interface NestedTag
public int doLifecycle() throws javax.servlet.jsp.JspException
NestedTag.doLifecycle()
for simple
tags. Returns -1
in this case, because
doTag()
does not have a return value.
doLifecycle
in interface NestedTag
doEndTag
call
javax.servlet.jsp.JspException
public javax.servlet.jsp.tagext.TagSupport getTag()
NestedTag.getTag()
.
Should not be called and throws a RuntimeException
,
because a simple tag is not an instance of TagSupport
.
getTag
in interface NestedTag
public javax.servlet.jsp.tagext.JspTag getWrappedTag()
NestedTag
getWrappedTag
in interface NestedTag
public void removeChilds()
NestedTag
removeChilds
in interface NestedTag
public java.util.List getChilds()
NestedTag
List
of childs.
getChilds
in interface NestedTag
List
of childspublic java.lang.Object getChild(int index)
NestedTag
getChild
in interface NestedTag
index
- the index
public void addTextChild(java.lang.String text)
NestedTag
addTextChild
in interface NestedTag
text
- the static textpublic void addDynamicChild(DynamicChild child)
NestedTag
TagUtil.evalBody(List, Object)
for details about child handling.
addDynamicChild
in interface NestedTag
child
- the dynamic child instancepublic NestedTag addTagChild(java.lang.Class tag)
NestedTag
NestedTag
will be created
automatically wrapping the specified tag. An empty attribute
Map
will be used for the tag.
addTagChild
in interface NestedTag
tag
- the tag classpublic NestedTag addTagChild(java.lang.Class tag, java.util.Map attributeMap)
NestedTag
NestedTag
will be created
automatically wrapping the specified tag. The attributes
Map
contains the attributes of this tag
(propertyname maps to propertyvalue).
addTagChild
in interface NestedTag
tag
- the tag classattributeMap
- the attribute mappublic NestedTag addTagChild(javax.servlet.jsp.tagext.TagSupport tag)
NestedTag
NestedTag
will be created automatically
wrapping the specified tag. An empty attribute Map
will be used for the tag.
addTagChild
in interface NestedTag
tag
- the tagpublic NestedTag addTagChild(javax.servlet.jsp.tagext.TagSupport tag, java.util.Map attributeMap)
NestedTag
NestedTag
will be created
automatically wrapping the specified tag. The attributes
Map
contains the attributes of this tag
(propertyname maps to propertyvalue).
addTagChild
in interface NestedTag
tag
- the tagattributeMap
- the attribute mappublic NestedTag addTagChild(javax.servlet.jsp.tagext.JspTag tag)
NestedTag
NestedTag
will be created automatically
wrapping the specified tag. An empty attribute Map
will be used for the tag.
addTagChild
in interface NestedTag
tag
- the tagpublic NestedTag addTagChild(javax.servlet.jsp.tagext.JspTag tag, java.util.Map attributeMap)
NestedTag
NestedTag
will be created
automatically wrapping the specified tag. The attributes
Map
contains the attributes of this tag
(propertyname maps to propertyvalue).
addTagChild
in interface NestedTag
tag
- the tagattributeMap
- the attribute mappublic void doTag() throws javax.servlet.jsp.JspException, java.io.IOException
doTag
in interface javax.servlet.jsp.tagext.SimpleTag
doTag
in class javax.servlet.jsp.tagext.SimpleTagSupport
javax.servlet.jsp.JspException
java.io.IOException
public javax.servlet.jsp.tagext.JspFragment getJspBody()
getJspBody
in class javax.servlet.jsp.tagext.SimpleTagSupport
public javax.servlet.jsp.JspContext getJspContext()
JspContext
.
getJspContext
in class javax.servlet.jsp.tagext.SimpleTagSupport
JspContext
public javax.servlet.jsp.tagext.JspTag getParent()
getParent
in interface javax.servlet.jsp.tagext.SimpleTag
getParent
in class javax.servlet.jsp.tagext.SimpleTagSupport
public void setJspBody(javax.servlet.jsp.tagext.JspFragment jspBody)
setJspBody
in interface javax.servlet.jsp.tagext.SimpleTag
setJspBody
in class javax.servlet.jsp.tagext.SimpleTagSupport
public void setJspContext(javax.servlet.jsp.JspContext jspContext)
setJspContext
on the body fragment, if the body fragment is an instance of
MockJspFragment
setJspContext
in interface javax.servlet.jsp.tagext.SimpleTag
setJspContext
in class javax.servlet.jsp.tagext.SimpleTagSupport
public void setParent(javax.servlet.jsp.tagext.JspTag parent)
setParent
in interface javax.servlet.jsp.tagext.SimpleTag
setParent
in class javax.servlet.jsp.tagext.SimpleTagSupport
public 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 |