Class SaxParserHandlerBundled

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

    @Service
    public class SaxParserHandlerBundled
    extends SaxParserHandler
    Provides access to schemas and DTDs to Java Web Start-launched app clients that do not have an app server product installation at hand.

    The DTDs and schemas are assumed to be in the classpath so that schemas are at /schemas/ and DTDs at /dtds/ This ParserHandler is used by Embedded GlassFish as well.

    Author:
    tjquinn
    • Constructor Detail

      • SaxParserHandlerBundled

        public SaxParserHandlerBundled()
        Creates a new instance of SaxParserHandlerBundled
    • Method Detail

      • resolveEntity

        public InputSource resolveEntity​(String publicID,
                                         String systemID)
                                  throws SAXException
        Returns an InputSource for the requested DTD or schema.

        This implementation returns an InputSource that wraps the result of getResourceAsStream, having located the requested schema in the classpath.

        Specified by:
        resolveEntity in interface EntityResolver
        Overrides:
        resolveEntity in class SaxParserHandler
        Parameters:
        publicID - public ID of the requested entity
        systemID - system ID of the requested entity
        Returns:
        InputSource for the requested entity; null if not available
        Throws:
        SAXException - in case of errors resolving the entity