gnu.xml.pipeline
Class WellFormednessFilter
- ContentHandler, ContentHandler2, DeclHandler, DTDHandler, EventConsumer, LexicalHandler
This filter reports fatal exceptions in the case of event streams that
are not well formed. The rules currently tested include:
- setDocumentLocator ... may be called only before startDocument
- startDocument/endDocument ... must be paired, and all other
calls (except setDocumentLocator) must be nested within these.
- startElement/endElement ... must be correctly paired, and
may never appear within CDATA sections.
- comment ... can't contain "--"
- character data ... can't contain "]]>"
- whitespace ... can't contain CR
- whitespace and character data must be within an element
- processing instruction ... can't contain "?>" or CR
- startCDATA/endCDATA ... must be correctly paired.
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.
void | characters(ch[] , int start, int length) - SAX2: passes this callback to the next consumer, if any
|
void | comment(ch[] , int start, int length) - SAX2: passes this callback to the next consumer, if any
|
void | endCDATA() - SAX2: passes this callback to the next consumer, if any
|
void | endDTD() - SAX2: passes this callback to the next consumer, if any
|
void | endDocument() - SAX2: passes this callback to the next consumer, if any
|
void | endElement(String uri, String localName, String qName) - SAX2: passes this callback to the next consumer, if any
|
void | ignorableWhitespace(ch[] , int start, int length) - SAX2: passes this callback to the next consumer, if any
|
void | notationDecl(String name, String publicId, String systemId) - SAX1: passes this callback to the next consumer, if any
|
void | processingInstruction(String target, String data) - SAX2: passes this callback to the next consumer, if any
|
void | reset() - Resets state as if any preceding event stream was well formed.
|
void | setDocumentLocator(Locator locator) - Throws an exception when called after startDocument.
|
void | startCDATA() - SAX2: passes this callback to the next consumer, if any
|
void | startDTD(String root, String publicId, String systemId) - SAX2: passes this callback to the next consumer, if any
|
void | startDocument() - SAX2: passes this callback to the next consumer, if any
|
void | startElement(String uri, String localName, String qName, Attributes atts) - SAX2: passes this callback to the next consumer, if any
|
void | unparsedEntityDecl(String name, String publicId, String systemId, String notationName) - SAX1: passes this callback to the next consumer, if any
|
attributeDecl , bind , chainTo , characters , comment , elementDecl , endCDATA , endDTD , endDocument , endElement , endEntity , endPrefixMapping , externalEntityDecl , getContentHandler , getDTDHandler , getDocumentLocator , getErrorHandler , getNext , getProperty , ignorableWhitespace , internalEntityDecl , notationDecl , processingInstruction , setContentHandler , setDTDHandler , setDocumentLocator , setErrorHandler , setProperty , skippedEntity , startCDATA , startDTD , startDocument , startElement , startEntity , startPrefixMapping , unparsedEntityDecl , xmlDecl |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
WellFormednessFilter
public WellFormednessFilter()
Swallows all events after performing well formedness checks.
characters
public void characters(ch[] ,
int start,
int length)
throws SAXException
SAX2: passes this callback to the next consumer, if any
- characters in interface EventFilter
comment
public void comment(ch[] ,
int start,
int length)
throws SAXException
SAX2: passes this callback to the next consumer, if any
- comment in interface EventFilter
endCDATA
public void endCDATA()
throws SAXException
SAX2: passes this callback to the next consumer, if any
- endCDATA in interface EventFilter
endDTD
public void endDTD()
throws SAXException
SAX2: passes this callback to the next consumer, if any
- endDTD in interface EventFilter
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.
- setDocumentLocator in interface EventFilter
locator
- the locator, to be used in error reporting or relative
URI resolution.
WellFormednessFilter.java --
Copyright (C) 1999,2000,2001 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.