freemarker.doc
Class ContentsBuilder

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by freemarker.doc.ContentsBuilder
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public final class ContentsBuilder
extends org.xml.sax.helpers.DefaultHandler

SAX content handler that builds a ContentList. Once the list has been built, the content list can be retrieved by using the getContentList() method.

Version:
$Id: ContentsBuilder.java 1152 2013-04-15 10:34:50Z run2000 $

Constructor Summary
ContentsBuilder()
          Creates new ContentsBuilder
 
Method Summary
 void characters(char[] ch, int start, int length)
          Event fired by the SAX parser when character data is encountered.
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
          Event fired by the SAX parser when an end tag is encountered.
 ContentList getContentList()
          Returns the built content list once the SAX parse is complete.
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
          Event fired by the SAX parser when a start tag is encountered.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentsBuilder

public ContentsBuilder()
Creates new ContentsBuilder

Method Detail

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes attributes)
                  throws org.xml.sax.SAXException
Event fired by the SAX parser when a start tag is encountered.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Event fired by the SAX parser when an end tag is encountered.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Event fired by the SAX parser when character data is encountered.

Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

getContentList

public ContentList getContentList()
Returns the built content list once the SAX parse is complete.

Returns:
the built ContentList