com.sun.xml.bind.unmarshaller
Class InterningXMLReader

java.lang.Object
  extended by org.xml.sax.helpers.XMLFilterImpl
      extended by com.sun.xml.bind.unmarshaller.InterningXMLReader
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.XMLFilter, org.xml.sax.XMLReader

public class InterningXMLReader
extends org.xml.sax.helpers.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.

Since:
JAXB RI 1.0.3

Constructor Summary
protected InterningXMLReader()
           
protected InterningXMLReader(org.xml.sax.XMLReader core)
           
 
Method Summary
static org.xml.sax.XMLReader adapt(org.xml.sax.XMLReader reader)
          Wraps the given XMLReader (if necessary) so that it performs string interning.
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
           
 void endPrefixMapping(java.lang.String prefix)
           
 void processingInstruction(java.lang.String target, java.lang.String data)
           
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
           
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
           
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InterningXMLReader

protected InterningXMLReader(org.xml.sax.XMLReader core)

InterningXMLReader

protected InterningXMLReader()
Method Detail

adapt

public static org.xml.sax.XMLReader adapt(org.xml.sax.XMLReader reader)
Wraps the given XMLReader (if necessary) so that it performs string interning.


endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.XMLFilterImpl
Throws:
org.xml.sax.SAXException

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
                      throws org.xml.sax.SAXException
Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler
Overrides:
endPrefixMapping in class org.xml.sax.helpers.XMLFilterImpl
Throws:
org.xml.sax.SAXException

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
Specified by:
processingInstruction in interface org.xml.sax.ContentHandler
Overrides:
processingInstruction in class org.xml.sax.helpers.XMLFilterImpl
Throws:
org.xml.sax.SAXException

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.XMLFilterImpl
Throws:
org.xml.sax.SAXException

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
                        throws org.xml.sax.SAXException
Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler
Overrides:
startPrefixMapping in class org.xml.sax.helpers.XMLFilterImpl
Throws:
org.xml.sax.SAXException