gnu.xml.pipeline

Class WellFormednessFilter

public final class WellFormednessFilter extends EventFilter

This filter reports fatal exceptions in the case of event streams that are not well formed. The rules currently tested include:

Other checks for event stream correctness may be provided in the future. For example, insisting that entity boundaries nest correctly, namespace scopes nest correctly, namespace values never contain relative URIs, attributes don't have "<" characters; and more.

Version: $Date: 2001/11/09 22:53:17 $

Author: David Brownell

Constructor Summary
WellFormednessFilter()
Swallows all events after performing well formedness checks.
WellFormednessFilter(EventConsumer consumer)
Passes events through to the specified consumer, after first processing them.
Method Summary
voidcharacters(char[] ch, int start, int length)
voidcomment(char[] ch, int start, int length)
voidendCDATA()
voidendDocument()
voidendDTD()
voidendElement(String uri, String localName, String qName)
voidignorableWhitespace(char[] ch, int start, int length)
voidnotationDecl(String name, String publicId, String systemId)
voidprocessingInstruction(String target, String data)
voidreset()
Resets state as if any preceding event stream was well formed.
voidsetDocumentLocator(Locator locator)
Throws an exception when called after startDocument.
voidstartCDATA()
voidstartDocument()
voidstartDTD(String root, String publicId, String systemId)
voidstartElement(String uri, String localName, String qName, Attributes atts)
voidunparsedEntityDecl(String name, String publicId, String systemId, String notationName)

Constructor Detail

WellFormednessFilter

public WellFormednessFilter()
Swallows all events after performing well formedness checks.

WellFormednessFilter

public WellFormednessFilter(EventConsumer consumer)
Passes events through to the specified consumer, after first processing them.

Method Detail

characters

public void characters(char[] ch, int start, int length)

comment

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

endCDATA

public void endCDATA()

endDocument

public void endDocument()

endDTD

public void endDTD()

endElement

public void endElement(String uri, String localName, String qName)

ignorableWhitespace

public void ignorableWhitespace(char[] ch, int start, int length)

notationDecl

public void notationDecl(String name, String publicId, String systemId)

processingInstruction

public void processingInstruction(String target, String data)

reset

public void reset()
Resets state as if any preceding event stream was well formed. Particularly useful if it ended through some sort of error, and the endDocument call wasn't made.

setDocumentLocator

public void setDocumentLocator(Locator locator)
Throws an exception when called after startDocument.

Parameters: locator the locator, to be used in error reporting or relative URI resolution.

Throws: IllegalStateException when called after the document has already been started

startCDATA

public void startCDATA()

startDocument

public void startDocument()

startDTD

public void startDTD(String root, String publicId, String systemId)

startElement

public void startElement(String uri, String localName, String qName, Attributes atts)

unparsedEntityDecl

public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName)

Source code is under GPL (with library exception) in the JAXP project at http://www.gnu.org/software/classpathx/jaxp
This documentation was derived from that source code on 2013-01-12.