Save This Page
Home » openjdk-7 » com.sun.xml.internal » xsom » parser » [javadoc | source]
com.sun.xml.internal.xsom.parser
static class: JAXPParser.XMLReaderEx [javadoc | source]
java.lang.Object
   org.xml.sax.helpers.XMLFilterImpl
      com.sun.xml.internal.xsom.parser.JAXPParser$XMLReaderEx

All Implemented Interfaces:
    ContentHandler, DTDHandler, ErrorHandler, XMLFilter, EntityResolver

XMLReader with improved error message for entity resolution failure. TODO: this class is completely stand-alone, so it shouldn't be an inner class.
Constructor:
 XMLReaderEx(XMLReader parent) 
Method from com.sun.xml.internal.xsom.parser.JAXPParser$XMLReaderEx Summary:
resolveEntity,   setDocumentLocator
Methods from org.xml.sax.helpers.XMLFilterImpl:
characters,   endDocument,   endElement,   endPrefixMapping,   error,   fatalError,   getContentHandler,   getDTDHandler,   getEntityResolver,   getErrorHandler,   getFeature,   getParent,   getProperty,   ignorableWhitespace,   notationDecl,   parse,   parse,   processingInstruction,   resolveEntity,   setContentHandler,   setDTDHandler,   setDocumentLocator,   setEntityResolver,   setErrorHandler,   setFeature,   setParent,   setProperty,   skippedEntity,   startDocument,   startElement,   startPrefixMapping,   unparsedEntityDecl,   warning
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sun.xml.internal.xsom.parser.JAXPParser$XMLReaderEx Detail:
 public InputSource resolveEntity(String publicId,
    String systemId) throws SAXException 
    Resolves entities and reports user-friendly error messages.

    Some XML parser (at least Xerces) does not report much information when it fails to resolve an entity, which is often quite frustrating. For example, if you are behind a firewall and the schema contains a reference to www.w3.org, and there is no entity resolver, the parser will just throw an IOException that doesn't contain any information about where that reference occurs nor what it is accessing.

    By implementing an EntityResolver and resolving the reference by ourselves, we can report an error message with all the necessary information to fix the problem.

    Note that we still need to the client-specified entity resolver to let the application handle entity resolution. Here we just catch an IOException and add more information.

 public  void setDocumentLocator(Locator locator)