PageDataImplpublic class PageDataImpl extends javax.servlet.jsp.tagext.PageData implements TagConstantsAn implementation of javax.servlet.jsp.tagext.PageData which
builds the XML view of a given page.
The XML view is built in two passes:
During the first pass, the FirstPassVisitor collects the attributes of the
top-level jsp:root and those of the jsp:root elements of any included
pages, and adds them to the jsp:root element of the XML view.
In addition, any taglib directives are converted into xmlns: attributes and
added to the jsp:root element of the XML view.
This pass ignores any nodes other than JspRoot and TaglibDirective.
During the second pass, the SecondPassVisitor produces the XML view, using
the combined jsp:root attributes determined in the first pass and any
remaining pages nodes (this pass ignores any JspRoot and TaglibDirective
nodes). |
Fields Summary |
---|
private static final String | JSP_VERSION | private static final String | CDATA_START_SECTION | private static final String | CDATA_END_SECTION | private StringBuffer | buf |
Constructors Summary |
---|
public PageDataImpl(Node.Nodes page, Compiler compiler)Constructor.
// First pass
FirstPassVisitor firstPass = new FirstPassVisitor(page.getRoot(),
compiler.getPageInfo());
page.visit(firstPass);
// Second pass
buf = new StringBuffer();
SecondPassVisitor secondPass
= new SecondPassVisitor(page.getRoot(), buf, compiler,
firstPass.getJspIdPrefix());
page.visit(secondPass);
|
Methods Summary |
---|
public java.io.InputStream | getInputStream()Returns the input stream of the XML view.
// Turn StringBuffer into InputStream
try {
return new ByteArrayInputStream(buf.toString().getBytes("UTF-8"));
} catch (UnsupportedEncodingException uee) {
// should never happen
throw new RuntimeException(uee.toString());
}
|
|