com.arsdigita.templating.html
Interface ContentHandler

All Known Implementing Classes:
DemoTagHandler

public interface ContentHandler

Receives notification of the logical content of a document.

This is similar to the ContentHandler interface in SAX. The difference is that this class expects the invoking HTMLParser to only send notifications of those elements that have been registered with the parser. In other words, this handler would most likely be only interested in handling special tags like the <footnote> tag (see HTMLParser). In a typical use case, regular HTML markup like <p> or <b> would not generate the startElement(String, AttributeMap) and endElement(String, AttributeMap) events.

Since:
2002-08-21
Version:
$Id: //core-platform/dev/src/com/arsdigita/templating/html/ContentHandler.java#4 $
Author:
Vadim Nasardinov (vadimn@redhat.com)

Method Summary
 void endDocument()
          Receives notification of the end of a document.
 void endElement(String qName)
          Receives notification of the end of an element.
 void startDocument()
          Receives notification of the beginning of a document.
 void startElement(String qName, AttributeMap attributes)
          Receives notification of the beginning of an element.
 void text(String text)
          Receives notification of textual data.
 

Method Detail

startDocument

public void startDocument()
                   throws HTMLParserException
Receives notification of the beginning of a document.

Throws:
HTMLParserException

endDocument

public void endDocument()
                 throws HTMLParserException
Receives notification of the end of a document.

Throws:
HTMLParserException

text

public void text(String text)
          throws HTMLParserException
Receives notification of textual data.

Throws:
HTMLParserException

startElement

public void startElement(String qName,
                         AttributeMap attributes)
                  throws HTMLParserException
Receives notification of the beginning of an element. The parser will only notify the handler of those elements for which HTMLParser.isRegistered(String) is true. Any other HTML markup will be treated as text and will be dispatched to text(String).

Throws:
HTMLParserException

endElement

public void endElement(String qName)
                throws HTMLParserException
Receives notification of the end of an element. The parser will only notify the handler of those elements for which HTMLParser.isRegistered(String) is true. Any other HTML markup will be treated as text and will be dispatched to text(String).

Throws:
HTMLParserException


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC