Package org.ccil.cowan.tagsoup
Class PYXWriter
- java.lang.Object
-
- org.ccil.cowan.tagsoup.PYXWriter
-
- All Implemented Interfaces:
ScanHandler,ContentHandler,LexicalHandler
public class PYXWriter extends Object implements ScanHandler, ContentHandler, LexicalHandler
A ContentHandler that generates PYX format instead of XML. Primarily useful for debugging.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadup(char[] buff, int offset, int length)Reports an attribute name without a value.voidaname(char[] buff, int offset, int length)Reports an attribute name; a value will follow.voidaval(char[] buff, int offset, int length)Reports an attribute value.voidcdsect(char[] buff, int offset, int length)Reports the content of a CDATA section (not a CDATA element)voidcharacters(char[] buff, int offset, int length)voidcmnt(char[] buff, int offset, int length)Reports a comment.voidcomment(char[] ch, int start, int length)voiddecl(char[] buff, int offset, int length)Reports a declaration - typically a DOCTYPEvoidendCDATA()voidendDocument()voidendDTD()voidendElement(String uri, String localname, String qname)voidendEntity(String name)voidendPrefixMapping(String prefix)voidentity(char[] buff, int offset, int length)Reports an entity reference or character reference.voideof(char[] buff, int offset, int length)Reports EOF.voidetag(char[] buff, int offset, int length)Reports an end-tag.intgetEntity()Returns the value of the last entity or character reference reported.voidgi(char[] buff, int offset, int length)Reports the general identifier (element type name) of a start-tag.voidignorableWhitespace(char[] buff, int offset, int length)voidpcdata(char[] buff, int offset, int length)Reports character content.voidpi(char[] buff, int offset, int length)Reports the data part of a processing instruction.voidpitarget(char[] buff, int offset, int length)Reports the target part of a processing instruction.voidprocessingInstruction(String target, String data)voidsetDocumentLocator(Locator locator)voidskippedEntity(String name)voidstagc(char[] buff, int offset, int length)Reports the close of a start-tag.voidstage(char[] buff, int offset, int length)Reports the close of an empty-tag.voidstartCDATA()voidstartDocument()voidstartDTD(String name, String publicId, String systemId)voidstartElement(String uri, String localname, String qname, Attributes atts)voidstartEntity(String name)voidstartPrefixMapping(String prefix, String uri)
-
-
-
Constructor Detail
-
PYXWriter
public PYXWriter(Writer w)
-
-
Method Detail
-
adup
public void adup(char[] buff, int offset, int length) throws SAXExceptionDescription copied from interface:ScanHandlerReports an attribute name without a value.- Specified by:
adupin interfaceScanHandler- Throws:
SAXException
-
aname
public void aname(char[] buff, int offset, int length) throws SAXExceptionDescription copied from interface:ScanHandlerReports an attribute name; a value will follow.- Specified by:
anamein interfaceScanHandler- Throws:
SAXException
-
aval
public void aval(char[] buff, int offset, int length) throws SAXExceptionDescription copied from interface:ScanHandlerReports an attribute value.- Specified by:
avalin interfaceScanHandler- Throws:
SAXException
-
cmnt
public void cmnt(char[] buff, int offset, int length) throws SAXExceptionDescription copied from interface:ScanHandlerReports a comment.- Specified by:
cmntin interfaceScanHandler- Throws:
SAXException
-
entity
public void entity(char[] buff, int offset, int length) throws SAXExceptionDescription copied from interface:ScanHandlerReports an entity reference or character reference.- Specified by:
entityin interfaceScanHandler- Throws:
SAXException
-
getEntity
public int getEntity()
Description copied from interface:ScanHandlerReturns the value of the last entity or character reference reported.- Specified by:
getEntityin interfaceScanHandler
-
eof
public void eof(char[] buff, int offset, int length) throws SAXExceptionDescription copied from interface:ScanHandlerReports EOF.- Specified by:
eofin interfaceScanHandler- Throws:
SAXException
-
etag
public void etag(char[] buff, int offset, int length) throws SAXExceptionDescription copied from interface:ScanHandlerReports an end-tag.- Specified by:
etagin interfaceScanHandler- Throws:
SAXException
-
decl
public void decl(char[] buff, int offset, int length) throws SAXExceptionDescription copied from interface:ScanHandlerReports a declaration - typically a DOCTYPE- Specified by:
declin interfaceScanHandler- Throws:
SAXException
-
gi
public void gi(char[] buff, int offset, int length) throws SAXExceptionDescription copied from interface:ScanHandlerReports the general identifier (element type name) of a start-tag.- Specified by:
giin interfaceScanHandler- Throws:
SAXException
-
cdsect
public void cdsect(char[] buff, int offset, int length) throws SAXExceptionDescription copied from interface:ScanHandlerReports the content of a CDATA section (not a CDATA element)- Specified by:
cdsectin interfaceScanHandler- Throws:
SAXException
-
pcdata
public void pcdata(char[] buff, int offset, int length) throws SAXExceptionDescription copied from interface:ScanHandlerReports character content.- Specified by:
pcdatain interfaceScanHandler- Throws:
SAXException
-
pitarget
public void pitarget(char[] buff, int offset, int length) throws SAXExceptionDescription copied from interface:ScanHandlerReports the target part of a processing instruction.- Specified by:
pitargetin interfaceScanHandler- Throws:
SAXException
-
pi
public void pi(char[] buff, int offset, int length) throws SAXExceptionDescription copied from interface:ScanHandlerReports the data part of a processing instruction.- Specified by:
piin interfaceScanHandler- Throws:
SAXException
-
stagc
public void stagc(char[] buff, int offset, int length) throws SAXExceptionDescription copied from interface:ScanHandlerReports the close of a start-tag.- Specified by:
stagcin interfaceScanHandler- Throws:
SAXException
-
stage
public void stage(char[] buff, int offset, int length) throws SAXExceptionDescription copied from interface:ScanHandlerReports the close of an empty-tag.- Specified by:
stagein interfaceScanHandler- Throws:
SAXException
-
characters
public void characters(char[] buff, int offset, int length) throws SAXException- Specified by:
charactersin interfaceContentHandler- Throws:
SAXException
-
endDocument
public void endDocument() throws SAXException- Specified by:
endDocumentin interfaceContentHandler- Throws:
SAXException
-
endElement
public void endElement(String uri, String localname, String qname) throws SAXException
- Specified by:
endElementin interfaceContentHandler- Throws:
SAXException
-
endPrefixMapping
public void endPrefixMapping(String prefix) throws SAXException
- Specified by:
endPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
ignorableWhitespace
public void ignorableWhitespace(char[] buff, int offset, int length) throws SAXException- Specified by:
ignorableWhitespacein interfaceContentHandler- Throws:
SAXException
-
processingInstruction
public void processingInstruction(String target, String data) throws SAXException
- Specified by:
processingInstructionin interfaceContentHandler- Throws:
SAXException
-
setDocumentLocator
public void setDocumentLocator(Locator locator)
- Specified by:
setDocumentLocatorin interfaceContentHandler
-
skippedEntity
public void skippedEntity(String name) throws SAXException
- Specified by:
skippedEntityin interfaceContentHandler- Throws:
SAXException
-
startDocument
public void startDocument() throws SAXException- Specified by:
startDocumentin interfaceContentHandler- Throws:
SAXException
-
startElement
public void startElement(String uri, String localname, String qname, Attributes atts) throws SAXException
- Specified by:
startElementin interfaceContentHandler- Throws:
SAXException
-
startPrefixMapping
public void startPrefixMapping(String prefix, String uri) throws SAXException
- Specified by:
startPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
comment
public void comment(char[] ch, int start, int length) throws SAXException- Specified by:
commentin interfaceLexicalHandler- Throws:
SAXException
-
endCDATA
public void endCDATA() throws SAXException- Specified by:
endCDATAin interfaceLexicalHandler- Throws:
SAXException
-
endDTD
public void endDTD() throws SAXException- Specified by:
endDTDin interfaceLexicalHandler- Throws:
SAXException
-
endEntity
public void endEntity(String name) throws SAXException
- Specified by:
endEntityin interfaceLexicalHandler- Throws:
SAXException
-
startCDATA
public void startCDATA() throws SAXException- Specified by:
startCDATAin interfaceLexicalHandler- Throws:
SAXException
-
startDTD
public void startDTD(String name, String publicId, String systemId) throws SAXException
- Specified by:
startDTDin interfaceLexicalHandler- Throws:
SAXException
-
startEntity
public void startEntity(String name) throws SAXException
- Specified by:
startEntityin interfaceLexicalHandler- Throws:
SAXException
-
-