|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.jsp.tagext.JspFragment com.mockrunner.mock.web.MockJspFragment
public class MockJspFragment
Mock implementation of JspFragment
.
The body of a simple tag is a JspFragment
.
All child handling methods of NestedSimpleTag
delegate to an underlying instance of this class.
Constructor Summary | |
---|---|
MockJspFragment(javax.servlet.jsp.JspContext jspContext)
|
|
MockJspFragment(javax.servlet.jsp.JspContext jspContext,
javax.servlet.jsp.tagext.JspTag parent)
|
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. |
void |
addTextChild(java.lang.String text)
Adds a text child simulating static body content. |
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.JspContext |
getJspContext()
Returns the JspContext . |
javax.servlet.jsp.tagext.JspTag |
getParent()
Returns the parent tag. |
void |
invoke(java.io.Writer writer)
Executes the fragment and directs all output to the given Writer, or the JspWriter returned by the getOut() method of the JspContext associated with the fragment if out is null (copied from JspFragment JavaDoc). |
void |
removeChilds()
Removes all childs. |
void |
setJspContext(javax.servlet.jsp.JspContext jspContext)
Sets the JspContext . |
void |
setParent(javax.servlet.jsp.tagext.JspTag parent)
Sets the parent tag. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MockJspFragment(javax.servlet.jsp.JspContext jspContext)
public MockJspFragment(javax.servlet.jsp.JspContext jspContext, javax.servlet.jsp.tagext.JspTag parent)
Method Detail |
---|
public javax.servlet.jsp.tagext.JspTag getParent()
public void setParent(javax.servlet.jsp.tagext.JspTag parent)
parent
- the parent tagpublic javax.servlet.jsp.JspContext getJspContext()
JspContext
.
getJspContext
in class javax.servlet.jsp.tagext.JspFragment
JspContext
public void setJspContext(javax.servlet.jsp.JspContext jspContext)
JspContext
. Also calls setJspContext
(or setPageContext
) for all child tags.
setPageContext
is only called if the specified JspContext
is an instance of PageContext
.
jspContext
- the JspContext
public void invoke(java.io.Writer writer) throws javax.servlet.jsp.JspException, java.io.IOException
JspFragment
JavaDoc).
invoke
in class javax.servlet.jsp.tagext.JspFragment
writer
- the Writer to output the fragment to, or null if output should be
sent to JspContext.getOut().
javax.servlet.jsp.JspException
java.io.IOException
public void removeChilds()
public java.util.List getChilds()
List
of childs.
List
of childspublic java.lang.Object getChild(int index)
index
- the index
public void addTextChild(java.lang.String text)
text
- the static textpublic void addDynamicChild(DynamicChild child)
TagUtil.evalBody(List, Object)
for details about child handling.
child
- the dynamic child instancepublic NestedTag addTagChild(java.lang.Class tag)
NestedTag
will be created
automatically wrapping the specified tag. An empty attribute
Map
will be used for the tag.
tag
- the tag classpublic NestedTag addTagChild(java.lang.Class tag, java.util.Map attributeMap)
NestedTag
will be created
automatically wrapping the specified tag. The attributes
Map
contains the attributes of this tag
(propertyname maps to propertyvalue).
tag
- the tag classattributeMap
- the attribute mappublic NestedTag addTagChild(javax.servlet.jsp.tagext.JspTag tag)
NestedTag
will be created automatically
wrapping the specified tag. An empty attribute Map
will be used for the tag.
tag
- the tagpublic NestedTag addTagChild(javax.servlet.jsp.tagext.JspTag tag, java.util.Map attributeMap)
NestedTag
will be created
automatically wrapping the specified tag. The attributes
Map
contains the attributes of this tag
(propertyname maps to propertyvalue).
tag
- the tagattributeMap
- the attribute map
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |