public class InterningXMLReader extends XMLFilterImpl
XMLReader
that interns all the string constants before
calling the ContentHandler
.
Most of the parsers out there (at least Crimson and Xerces) supports
SAX http://xml.org/sax/features/string-interning feature,
but if the parser doesn't support it (or if the SAX events is read
from components other than XMLReader
, this adaptor is used
to make all strings interned.
Modifier | Constructor and Description |
---|---|
protected |
InterningXMLReader() |
protected |
InterningXMLReader(XMLReader core) |
Modifier and Type | Method and Description |
---|---|
static XMLReader |
adapt(XMLReader reader)
Wraps the given
XMLReader (if necessary) so that
it performs string interning. |
void |
endElement(String uri,
String localName,
String qName) |
void |
endPrefixMapping(String prefix) |
void |
processingInstruction(String target,
String data) |
void |
startElement(String uri,
String localName,
String qName,
Attributes atts) |
void |
startPrefixMapping(String prefix,
String uri) |
characters, endDocument, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, parse, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startDocument, unparsedEntityDecl, warning
protected InterningXMLReader(XMLReader core)
protected InterningXMLReader()
public static XMLReader adapt(XMLReader reader)
XMLReader
(if necessary) so that
it performs string interning.public void endElement(String uri, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class XMLFilterImpl
SAXException
public void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping
in interface ContentHandler
endPrefixMapping
in class XMLFilterImpl
SAXException
public void processingInstruction(String target, String data) throws SAXException
processingInstruction
in interface ContentHandler
processingInstruction
in class XMLFilterImpl
SAXException
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
startElement
in interface ContentHandler
startElement
in class XMLFilterImpl
SAXException
public void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping
in interface ContentHandler
startPrefixMapping
in class XMLFilterImpl
SAXException
Copyright © 2024 Oracle Corporation. All rights reserved.