FileDocCategorySizeDatePackage
PageDataImpl.javaAPI DocApache Tomcat 6.0.1421501Fri Jul 20 04:20:32 BST 2007org.apache.jasper.compiler

PageDataImpl

public class PageDataImpl extends javax.servlet.jsp.tagext.PageData implements TagConstants
An 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).
author
Jan Luehe

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.

param
page the page nodes from which to generate the XML view


                      
        
	          

	// 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.InputStreamgetInputStream()
Returns the input stream of the XML view.

return
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());
        }