Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.sitemesh.parser
Class DOMPage  view DOMPage download DOMPage.java

java.lang.Object
  extended bycom.sitemesh.parser.AbstractPage
      extended bycom.sitemesh.parser.AbstractHTMLPage
          extended bycom.sitemesh.parser.DOMPage
All Implemented Interfaces:
com.sitemesh.HTMLPage, com.sitemesh.Page

public class DOMPage
extends AbstractHTMLPage

Implementation of com.sitemesh.HTMLPage that populates itself from a parsed DOM document.

Version:
$Revision: 1.7 $

Field Summary
private  org.w3c.dom.html.HTMLBodyElement bodyTag
          BODY element.
private  org.w3c.dom.html.HTMLDocument document
          Entire Document.
private  org.w3c.dom.html.HTMLHeadElement headTag
          HEAD element.
 
Fields inherited from class com.sitemesh.parser.AbstractPage
pageData, request
 
Constructor Summary
DOMPage(byte[] pageData, org.w3c.dom.html.HTMLDocument document)
          Create instance and set all initial properties and data.
 
Method Summary
private  void addAttributeList(java.lang.String prefix, org.w3c.dom.NamedNodeMap attributes)
          Iterate through the attributes of an element and add them as properties.
private  void serialize(java.io.Writer out, org.w3c.dom.Element element)
          Serialize an Element to a stream, but don't write outermost tags, only contents.
 void writeBody(java.io.Writer out)
          Serialize BODY contents to stream.
 void writeHead(java.io.Writer out)
          Serialize HEAD contents to stream.
 
Methods inherited from class com.sitemesh.parser.AbstractHTMLPage
getDecoratorName, getTitle, writeBody, writeHead
 
Methods inherited from class com.sitemesh.parser.AbstractPage
addProperty, getBooleanProperty, getContentLength, getIntProperty, getLongProperty, getProperties, getProperty, getPropertyKeys, getPropertySize, getRequest, isPropertySet, noNull, setRequest, shouldCache, writePage, writePage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sitemesh.Page
getBooleanProperty, getContentLength, getIntProperty, getLongProperty, getProperties, getProperty, getPropertyKeys, getPropertySize, getRequest, isPropertySet, setRequest, shouldCache, writePage, writePage
 

Field Detail

bodyTag

private org.w3c.dom.html.HTMLBodyElement bodyTag
BODY element.


headTag

private org.w3c.dom.html.HTMLHeadElement headTag
HEAD element.


document

private org.w3c.dom.html.HTMLDocument document
Entire Document.

Constructor Detail

DOMPage

public DOMPage(byte[] pageData,
               org.w3c.dom.html.HTMLDocument document)
Create instance and set all initial properties and data.

Method Detail

addAttributeList

private void addAttributeList(java.lang.String prefix,
                              org.w3c.dom.NamedNodeMap attributes)
Iterate through the attributes of an element and add them as properties.


serialize

private void serialize(java.io.Writer out,
                       org.w3c.dom.Element element)
                throws java.io.IOException
Serialize an Element to a stream, but don't write outermost tags, only contents.


writeHead

public void writeHead(java.io.Writer out)
               throws java.io.IOException
Serialize HEAD contents to stream.

Specified by:
writeHead in interface com.sitemesh.HTMLPage
Specified by:
writeHead in class AbstractHTMLPage

writeBody

public void writeBody(java.io.Writer out)
               throws java.io.IOException
Serialize BODY contents to stream.

Specified by:
writeBody in interface com.sitemesh.HTMLPage
Specified by:
writeBody in class AbstractHTMLPage