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

Quick Search    Search Deep

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

java.lang.Object
  extended bycom.sitemesh.parser.AbstractPageParser
      extended bycom.sitemesh.parser.DOMPageParser
All Implemented Interfaces:
com.sitemesh.PageParser

public class DOMPageParser
extends AbstractPageParser

Implementation of com.sitemesh.PageParser that builds up a com.sitemesh.HTMLPage using DOM.

This implementation uses OpenXML 1.2 as it is capable of parsing (and beform basic clean-up operations) on HTML.

Version:
$Revision: 1.7 $

Constructor Summary
DOMPageParser()
           
 
Method Summary
 com.sitemesh.Page parse(byte[] data)
          Send data to DOM parser and build new DOMPage.
private  org.w3c.dom.html.HTMLDocument parseHTML(byte[] data)
          Parse the data and return a DOM HTMLDocument.
 
Methods inherited from class com.sitemesh.parser.AbstractPageParser
parse, parse, parse, parse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOMPageParser

public DOMPageParser()
Method Detail

parse

public com.sitemesh.Page parse(byte[] data)
                        throws java.io.IOException
Send data to DOM parser and build new DOMPage. If the data cannot be parsed, an UnParsedPage is returned instead.

Specified by:
parse in interface com.sitemesh.PageParser
Specified by:
parse in class AbstractPageParser

parseHTML

private org.w3c.dom.html.HTMLDocument parseHTML(byte[] data)
                                         throws java.io.IOException,
                                                org.xml.sax.SAXException
Parse the data and return a DOM HTMLDocument.