Code example for StreamSource

Methods: getInputStreamgetPublicIdgetReadergetSystemId

    public void validate(Source source, Result result) 
        throws SAXException, IOException { 
        if (result == null) {
            final StreamSource streamSource = (StreamSource) source;
            XMLInputSource input = new XMLInputSource(streamSource.getPublicId(), streamSource.getSystemId(), null);
            // Gets the parser configuration. We'll create and initialize a new one, if we  
            // haven't created one before or if the previous one was garbage collected. 
            XMLParserConfiguration config = (XMLParserConfiguration) fConfiguration.get();
            if (config == null) {
                config = initialize();
            // If settings have changed on the component manager, refresh the error handler and entity resolver. 
            else if (fComponentManager.getFeature(PARSER_SETTINGS)) {
                config.setProperty(ENTITY_RESOLVER, fComponentManager.getProperty(ENTITY_RESOLVER));
                config.setProperty(ERROR_HANDLER, fComponentManager.getProperty(ERROR_HANDLER));