Code example for SAXNotSupportedException

0
        if (name == null) {
            throw new NullPointerException("name == null");
        } 
 
        if (name.equals(LEXICAL_HANDLER_PROPERTY)) {
            // The object must implement LexicalHandler 
            if (value instanceof LexicalHandler || value == null) {
                this.lexicalHandler = (LexicalHandler) value;
                return; 
            } 
            throw new SAXNotSupportedException("value doesn't implement " +
                    "org.xml.sax.ext.LexicalHandler"); 
        } 
 
        throw new SAXNotRecognizedException(name);
    } 
 
    public void setEntityResolver(EntityResolver resolver) {
        this.entityResolver = resolver;
    }