Java 8 XMLFilterImpl - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 XMLFilterImpl class.

This code example shows how to use the following methods:getContentHandler, getDTDHandler, getProperty, setErrorHandler
    public void chainTo (XMLFilterImpl next)
    { 
        if (this.next != null)
            throw new IllegalStateException ();
 
        docNext = next.getContentHandler ();
        if (docHandler == null) 
            docHandler = docNext; 
        dtdNext = next.getDTDHandler ();
        if (dtdHandler == null)
            dtdHandler = dtdNext;
 
        try { 
            declNext = (DeclHandler) next.getProperty (DECL_HANDLER);
            if (declHandler == null)
                declHandler = declNext;
        } catch (SAXException e) { /* leave value null */ }
        try { 
            lexNext = (LexicalHandler) next.getProperty (LEXICAL_HANDLER);
            if (lexHandler == null)

5
CodeRank
This code example shows how to use the following methods:getFeature, setFeature
    } 
 
    public void testGetSetFeature() { 
        // Ordinary case 
        try { 
            child.setFeature("foo", true);
            assertEquals(true, child.getFeature("foo"));
 
            child.setFeature("foo", false);
            assertEquals(false, child.getFeature("foo"));
        } catch (SAXNotRecognizedException e) {
            throw new RuntimeException("Unexpected exception", e);
        } catch (SAXNotSupportedException e) {
            throw new RuntimeException("Unexpected exception", e);
        } 
 
        // No parent case 
        try { 
            orphan.setFeature("foo", false);
            fail("SAXNotRecognizedException expected");
5
CodeRank
This code example shows how to use the following methods:setContentHandler
                lastFilter.setLexicalHandler(newLexicalHandler);
            } 
            else if (lastStep instanceof XMLFilterImpl) {
                /* It's a standard XML Filter, which doesn't accept lexical events */ 
                final XMLFilterImpl lastFilter = (XMLFilterImpl) lastStep;
                lastFilter.setContentHandler(newContentHandler);
            } 
            else if (lastStep instanceof TransformerHandler) {
                /* It's an XSLT stylesheet */ 
                final TransformerHandler lastTransform = (TransformerHandler) lastStep;
                /* Wire it up to forward to our new handler */ 
                final SAXResult result = new SAXResult();
                result.setHandler(newContentHandler);
                result.setLexicalHandler(newLexicalHandler);
                lastTransform.setResult(result);
            } 
            else { 
                /* Last step closed the pipeline so we can't add this new one */ 
                throw new IllegalStateException("Last step added closed this pipeline");
            } 
3
CodeRank
This code example shows how to use the following methods:setParent
            inOperation = true;
        } else if (inOperation && outputPartElementName.equals(localName)) {
            if (attributes.getValue("href") != null) throw new SAXNotSupportedException("href attributes not supported");
            if (debugParse) System.out.println("Found Part: "+localName);
            if (resultHandler != null) {
                resultHandler.setParent(this);
                getParent().setContentHandler(resultHandler);
            } else { 
                resultBuffer = new StringBuffer();
            } 
            inResult = true;
        } else if (!inFault) {
            if (debugParse) System.out.println("Found Unknown Element: <"+qName+">    ns:"+uri);
            inResult = false;
            inSoapEnv = false;
            inSoapBody = false;
        } 
    } 
 
    public void endElement(String uri, String localName, String qName) throws SAXException {
5
CodeRank
See Code Examples for Java 8 XMLFilterImpl Methods: