org.ccil.cowan.tagsoup

Class PYXWriter

Implemented Interfaces:
ContentHandler, LexicalHandler, ScanHandler

public class PYXWriter
extends java.lang.Object
implements ScanHandler, ContentHandler, LexicalHandler

A ContentHandler that generates PYX format instead of XML. Primarily useful for debugging.

Constructor Summary

PYXWriter(Writer w)

Method Summary

void
adup(char[] buff, int offset, int length)
Reports an attribute name without a value.
void
aname(char[] buff, int offset, int length)
Reports an attribute name; a value will follow.
void
aval(char[] buff, int offset, int length)
Reports an attribute value.
void
characters(char[] buff, int offset, int length)
void
cmnt(char[] buff, int offset, int length)
Reports a comment.
void
comment(char[] ch, int start, int length)
void
decl(char[] buff, int offset, int length)
Reports a <!....> declaration - typically a DOCTYPE
void
endCDATA()
void
endDTD()
void
endDocument()
void
endElement(String uri, String localname, String qname)
void
endEntity(String name)
void
endPrefixMapping(String prefix)
void
entity(char[] buff, int offset, int length)
Reports an entity reference or character reference.
void
eof(char[] buff, int offset, int length)
Reports EOF.
void
etag(char[] buff, int offset, int length)
Reports an end-tag.
char
getEntity()
Returns the value of the last entity or character reference reported.
void
gi(char[] buff, int offset, int length)
Reports the general identifier (element type name) of a start-tag.
void
ignorableWhitespace(char[] buff, int offset, int length)
void
pcdata(char[] buff, int offset, int length)
Reports character content.
void
pi(char[] buff, int offset, int length)
Reports the data part of a processing instruction.
void
pitarget(char[] buff, int offset, int length)
Reports the target part of a processing instruction.
void
processingInstruction(String target, String data)
void
setDocumentLocator(Locator locator)
void
skippedEntity(String name)
void
stagc(char[] buff, int offset, int length)
Reports the close of a start-tag.
void
stage(char[] buff, int offset, int length)
Reports the close of an empty-tag.
void
startCDATA()
void
startDTD(String name, String publicId, String systemId)
void
startDocument()
void
startElement(String uri, String localname, String qname, Attributes atts)
void
startEntity(String name)
void
startPrefixMapping(String prefix, String uri)

Constructor Details

PYXWriter

public PYXWriter(Writer w)

Method Details

adup

public void adup(char[] buff,
                 int offset,
                 int length)
            throws SAXException
Reports an attribute name without a value.
Specified by:
adup in interface ScanHandler

aname

public void aname(char[] buff,
                  int offset,
                  int length)
            throws SAXException
Reports an attribute name; a value will follow.
Specified by:
aname in interface ScanHandler

aval

public void aval(char[] buff,
                 int offset,
                 int length)
            throws SAXException
Reports an attribute value.
Specified by:
aval in interface ScanHandler

characters

public void characters(char[] buff,
                       int offset,
                       int length)
            throws SAXException

cmnt

public void cmnt(char[] buff,
                 int offset,
                 int length)
            throws SAXException
Reports a comment.
Specified by:
cmnt in interface ScanHandler

comment

public void comment(char[] ch,
                    int start,
                    int length)
            throws SAXException

decl

public void decl(char[] buff,
                 int offset,
                 int length)
            throws SAXException
Reports a <!....> declaration - typically a DOCTYPE
Specified by:
decl in interface ScanHandler

endCDATA

public void endCDATA()
            throws SAXException

endDTD

public void endDTD()
            throws SAXException

endDocument

public void endDocument()
            throws SAXException

endElement

public void endElement(String uri,
                       String localname,
                       String qname)
            throws SAXException

endEntity

public void endEntity(String name)
            throws SAXException

endPrefixMapping

public void endPrefixMapping(String prefix)
            throws SAXException

entity

public void entity(char[] buff,
                   int offset,
                   int length)
            throws SAXException
Reports an entity reference or character reference.
Specified by:
entity in interface ScanHandler

eof

public void eof(char[] buff,
                int offset,
                int length)
            throws SAXException
Reports EOF.
Specified by:
eof in interface ScanHandler

etag

public void etag(char[] buff,
                 int offset,
                 int length)
            throws SAXException
Reports an end-tag.
Specified by:
etag in interface ScanHandler

getEntity

public char getEntity()
Returns the value of the last entity or character reference reported.
Specified by:
getEntity in interface ScanHandler

gi

public void gi(char[] buff,
               int offset,
               int length)
            throws SAXException
Reports the general identifier (element type name) of a start-tag.
Specified by:
gi in interface ScanHandler

ignorableWhitespace

public void ignorableWhitespace(char[] buff,
                                int offset,
                                int length)
            throws SAXException

pcdata

public void pcdata(char[] buff,
                   int offset,
                   int length)
            throws SAXException
Reports character content.
Specified by:
pcdata in interface ScanHandler

pi

public void pi(char[] buff,
               int offset,
               int length)
            throws SAXException
Reports the data part of a processing instruction.
Specified by:
pi in interface ScanHandler

pitarget

public void pitarget(char[] buff,
                     int offset,
                     int length)
            throws SAXException
Reports the target part of a processing instruction.
Specified by:
pitarget in interface ScanHandler

processingInstruction

public void processingInstruction(String target,
                                  String data)
            throws SAXException

setDocumentLocator

public void setDocumentLocator(Locator locator)

skippedEntity

public void skippedEntity(String name)
            throws SAXException

stagc

public void stagc(char[] buff,
                  int offset,
                  int length)
            throws SAXException
Reports the close of a start-tag.
Specified by:
stagc in interface ScanHandler

stage

public void stage(char[] buff,
                  int offset,
                  int length)
            throws SAXException
Reports the close of an empty-tag.
Specified by:
stage in interface ScanHandler

startCDATA

public void startCDATA()
            throws SAXException

startDTD

public void startDTD(String name,
                     String publicId,
                     String systemId)
            throws SAXException

startDocument

public void startDocument()
            throws SAXException

startElement

public void startElement(String uri,
                         String localname,
                         String qname,
                         Attributes atts)
            throws SAXException

startEntity

public void startEntity(String name)
            throws SAXException

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
            throws SAXException

Licence: Academic Free License 3.0 and/or GPL 2.0