类org.xml.sax.ext.DeclHandler源码实例Demo

下面列出了怎么用org.xml.sax.ext.DeclHandler的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: exificient   文件: SAXDecoder.java
public DocTypeTextLexicalHandler(DeclHandler dh) throws SAXException {
	// this.dh = dh;

	xmlReader = XMLReaderFactory.createXMLReader();

	// xmlReader.setProperty(
	// "http://xml.org/sax/properties/lexical-handler",
	// lh);

	// DTD
	xmlReader.setFeature(
			"http://xml.org/sax/features/resolve-dtd-uris", false);
	// *skip* resolving entities like DTDs
	xmlReader.setEntityResolver(new NoEntityResolver());

	xmlReader.setProperty(
			"http://xml.org/sax/properties/declaration-handler", dh);
}
 
源代码2 项目: jlibs   文件: BaseXMLReader.java
protected boolean _setProperty(String name, Object value) throws SAXNotSupportedException{
    if(LEXICAL_HANDLER.equals(name) || LEXICAL_HANDLER_ALT.equals(name)){
        if(value==null || value instanceof LexicalHandler){
            handler.setLexicalHandler((LexicalHandler)value);
            return true;
        }else
            throw new SAXNotSupportedException("value must implement "+LexicalHandler.class);
    }else if(DECL_HANDLER.equals(name) || DECL_HANDLER_ALT.equals(name)){
        if(value==null || value instanceof DeclHandler){
            handler.setDeclHandler((DeclHandler)value);
            return true;
        }else
            throw new SAXNotSupportedException("value must implement "+DeclHandler.class);
    }else
        return false;
}
 
源代码3 项目: openjdk-jdk9   文件: SAXParserTest02.java
/**
 * Test to set and get the declaration-handler.
 *
 * @param saxparser a SAXParser instance.
 * @throws SAXException If any parse errors occur.
 */
@Test(dataProvider = "parser-provider")
public void testProperty06(SAXParser saxparser) throws SAXException {
    MyDeclHandler myDeclHandler = new MyDeclHandler();
    saxparser.setProperty(DECL_HANDLER, myDeclHandler);
    assertTrue(saxparser.getProperty(DECL_HANDLER) instanceof DeclHandler);
}
 
源代码4 项目: exificient   文件: SAXDecoder.java
public void setProperty(String name, Object value)
		throws SAXNotRecognizedException, SAXNotSupportedException {
	if ("http://xml.org/sax/properties/lexical-handler".equals(name)) {
		this.lexicalHandler = (LexicalHandler) value;
	} else if ("http://xml.org/sax/properties/declaration-handler"
			.equals(name)) {
		this.declHandler = (DeclHandler) value;
	} else {
		throw new SAXNotRecognizedException(name);
	}
}
 
源代码5 项目: jlibs   文件: SAXDelegate.java
/**
 * Registers given handler with all its implementing interfaces.
 * This would be handy if you want to register to all interfaces
 * implemented by given handler object
 *
 * @param handler Object implementing one or more sax handler interfaces
 */
public void setHandler(Object handler){
    if(handler instanceof ContentHandler)
        setContentHandler((ContentHandler)handler);
    if(handler instanceof EntityResolver)
        setEntityResolver((EntityResolver)handler);
    if(handler instanceof ErrorHandler)
        setErrorHandler((ErrorHandler)handler);
    if(handler instanceof DTDHandler)
        setDTDHandler((DTDHandler)handler);
    if(handler instanceof LexicalHandler)
        setLexicalHandler((LexicalHandler)handler);
    if(handler instanceof DeclHandler)
        setDeclHandler((DeclHandler)handler);
}
 
源代码6 项目: jlibs   文件: AsyncXMLReader.java
@Override
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException{
    if(LEXICAL_HANDLER.equals(name) || LEXICAL_HANDLER_ALT.equals(name)){
        if(value==null || value instanceof LexicalHandler)
            lexicalHandler = (LexicalHandler)value;
        else
            throw new SAXNotSupportedException("value must implement "+LexicalHandler.class);
    }else if(DECL_HANDLER.equals(name) || DECL_HANDLER_ALT.equals(name)){
        if(value==null || value instanceof DeclHandler)
            declHandler = (DeclHandler)value;
        else
            throw new SAXNotSupportedException("value must implement "+DeclHandler.class);
    }else
        throw new SAXNotRecognizedException();
}
 
源代码7 项目: TencentKona-8   文件: SAXDocumentParser.java
public void setProperty(String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
        if (value instanceof LexicalHandler) {
            setLexicalHandler((LexicalHandler)value);
        } else {
            throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
        }
    } else if (name.equals(Properties.DTD_DECLARATION_HANDLER_PROPERTY)) {
        if (value instanceof DeclHandler) {
            setDeclHandler((DeclHandler)value);
        } else {
            throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY)) {
        if (value instanceof Map) {
            setExternalVocabularies((Map)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY)) {
        if (value instanceof Map) {
            setRegisteredEncodingAlgorithms((Map)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY)) {
        if (value instanceof EncodingAlgorithmContentHandler) {
            setEncodingAlgorithmContentHandler((EncodingAlgorithmContentHandler)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY)) {
        if (value instanceof PrimitiveTypeContentHandler) {
            setPrimitiveTypeContentHandler((PrimitiveTypeContentHandler)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.BUFFER_SIZE_PROPERTY)) {
        if (value instanceof Integer) {
            setBufferSize(((Integer)value).intValue());
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.BUFFER_SIZE_PROPERTY);
        }
    } else {
        throw new SAXNotRecognizedException(CommonResourceBundle.getInstance().
                getString("message.propertyNotRecognized", new Object[]{name}));
    }
}
 
源代码8 项目: TencentKona-8   文件: SAXDocumentParser.java
public void setDeclHandler(DeclHandler handler) {
    _declHandler = handler;
}
 
源代码9 项目: TencentKona-8   文件: SAXDocumentParser.java
public DeclHandler getDeclHandler() {
    return _declHandler;
}
 
源代码10 项目: jdk8u60   文件: SAXDocumentParser.java
public void setProperty(String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
        if (value instanceof LexicalHandler) {
            setLexicalHandler((LexicalHandler)value);
        } else {
            throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
        }
    } else if (name.equals(Properties.DTD_DECLARATION_HANDLER_PROPERTY)) {
        if (value instanceof DeclHandler) {
            setDeclHandler((DeclHandler)value);
        } else {
            throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY)) {
        if (value instanceof Map) {
            setExternalVocabularies((Map)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY)) {
        if (value instanceof Map) {
            setRegisteredEncodingAlgorithms((Map)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY)) {
        if (value instanceof EncodingAlgorithmContentHandler) {
            setEncodingAlgorithmContentHandler((EncodingAlgorithmContentHandler)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY)) {
        if (value instanceof PrimitiveTypeContentHandler) {
            setPrimitiveTypeContentHandler((PrimitiveTypeContentHandler)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.BUFFER_SIZE_PROPERTY)) {
        if (value instanceof Integer) {
            setBufferSize(((Integer)value).intValue());
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.BUFFER_SIZE_PROPERTY);
        }
    } else {
        throw new SAXNotRecognizedException(CommonResourceBundle.getInstance().
                getString("message.propertyNotRecognized", new Object[]{name}));
    }
}
 
源代码11 项目: jdk8u60   文件: SAXDocumentParser.java
public void setDeclHandler(DeclHandler handler) {
    _declHandler = handler;
}
 
源代码12 项目: jdk8u60   文件: SAXDocumentParser.java
public DeclHandler getDeclHandler() {
    return _declHandler;
}
 
源代码13 项目: openjdk-jdk8u   文件: SAXDocumentParser.java
public void setProperty(String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
        if (value instanceof LexicalHandler) {
            setLexicalHandler((LexicalHandler)value);
        } else {
            throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
        }
    } else if (name.equals(Properties.DTD_DECLARATION_HANDLER_PROPERTY)) {
        if (value instanceof DeclHandler) {
            setDeclHandler((DeclHandler)value);
        } else {
            throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY)) {
        if (value instanceof Map) {
            setExternalVocabularies((Map)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY)) {
        if (value instanceof Map) {
            setRegisteredEncodingAlgorithms((Map)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY)) {
        if (value instanceof EncodingAlgorithmContentHandler) {
            setEncodingAlgorithmContentHandler((EncodingAlgorithmContentHandler)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY)) {
        if (value instanceof PrimitiveTypeContentHandler) {
            setPrimitiveTypeContentHandler((PrimitiveTypeContentHandler)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.BUFFER_SIZE_PROPERTY)) {
        if (value instanceof Integer) {
            setBufferSize(((Integer)value).intValue());
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.BUFFER_SIZE_PROPERTY);
        }
    } else {
        throw new SAXNotRecognizedException(CommonResourceBundle.getInstance().
                getString("message.propertyNotRecognized", new Object[]{name}));
    }
}
 
源代码14 项目: openjdk-jdk8u   文件: SAXDocumentParser.java
public void setDeclHandler(DeclHandler handler) {
    _declHandler = handler;
}
 
源代码15 项目: openjdk-jdk8u   文件: SAXDocumentParser.java
public DeclHandler getDeclHandler() {
    return _declHandler;
}
 
源代码16 项目: ph-commons   文件: SAXReaderDefaultSettings.java
public static void setDeclarationHandler (@Nullable final DeclHandler aDeclHandler)
{
  setPropertyValue (EXMLParserProperty.SAX_DECLARATION_HANDLER, aDeclHandler);
}
 
源代码17 项目: openjdk-jdk8u-backup   文件: SAXDocumentParser.java
public void setProperty(String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
        if (value instanceof LexicalHandler) {
            setLexicalHandler((LexicalHandler)value);
        } else {
            throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
        }
    } else if (name.equals(Properties.DTD_DECLARATION_HANDLER_PROPERTY)) {
        if (value instanceof DeclHandler) {
            setDeclHandler((DeclHandler)value);
        } else {
            throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY)) {
        if (value instanceof Map) {
            setExternalVocabularies((Map)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY)) {
        if (value instanceof Map) {
            setRegisteredEncodingAlgorithms((Map)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY)) {
        if (value instanceof EncodingAlgorithmContentHandler) {
            setEncodingAlgorithmContentHandler((EncodingAlgorithmContentHandler)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY)) {
        if (value instanceof PrimitiveTypeContentHandler) {
            setPrimitiveTypeContentHandler((PrimitiveTypeContentHandler)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.BUFFER_SIZE_PROPERTY)) {
        if (value instanceof Integer) {
            setBufferSize(((Integer)value).intValue());
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.BUFFER_SIZE_PROPERTY);
        }
    } else {
        throw new SAXNotRecognizedException(CommonResourceBundle.getInstance().
                getString("message.propertyNotRecognized", new Object[]{name}));
    }
}
 
源代码18 项目: openjdk-jdk8u-backup   文件: SAXDocumentParser.java
public void setDeclHandler(DeclHandler handler) {
    _declHandler = handler;
}
 
源代码19 项目: openjdk-jdk8u-backup   文件: SAXDocumentParser.java
public DeclHandler getDeclHandler() {
    return _declHandler;
}
 
源代码20 项目: openjdk-jdk9   文件: SAXDocumentParser.java
public void setProperty(String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
        if (value instanceof LexicalHandler) {
            setLexicalHandler((LexicalHandler)value);
        } else {
            throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
        }
    } else if (name.equals(Properties.DTD_DECLARATION_HANDLER_PROPERTY)) {
        if (value instanceof DeclHandler) {
            setDeclHandler((DeclHandler)value);
        } else {
            throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY)) {
        if (value instanceof Map) {
            setExternalVocabularies((Map)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY)) {
        if (value instanceof Map) {
            setRegisteredEncodingAlgorithms((Map)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY)) {
        if (value instanceof EncodingAlgorithmContentHandler) {
            setEncodingAlgorithmContentHandler((EncodingAlgorithmContentHandler)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY)) {
        if (value instanceof PrimitiveTypeContentHandler) {
            setPrimitiveTypeContentHandler((PrimitiveTypeContentHandler)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.BUFFER_SIZE_PROPERTY)) {
        if (value instanceof Integer) {
            setBufferSize(((Integer)value).intValue());
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.BUFFER_SIZE_PROPERTY);
        }
    } else {
        throw new SAXNotRecognizedException(CommonResourceBundle.getInstance().
                getString("message.propertyNotRecognized", new Object[]{name}));
    }
}
 
源代码21 项目: openjdk-jdk9   文件: SAXDocumentParser.java
public void setDeclHandler(DeclHandler handler) {
    _declHandler = handler;
}
 
源代码22 项目: openjdk-jdk9   文件: SAXDocumentParser.java
public DeclHandler getDeclHandler() {
    return _declHandler;
}
 
源代码23 项目: hottub   文件: SAXDocumentParser.java
public void setProperty(String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
        if (value instanceof LexicalHandler) {
            setLexicalHandler((LexicalHandler)value);
        } else {
            throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
        }
    } else if (name.equals(Properties.DTD_DECLARATION_HANDLER_PROPERTY)) {
        if (value instanceof DeclHandler) {
            setDeclHandler((DeclHandler)value);
        } else {
            throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY)) {
        if (value instanceof Map) {
            setExternalVocabularies((Map)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY)) {
        if (value instanceof Map) {
            setRegisteredEncodingAlgorithms((Map)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY)) {
        if (value instanceof EncodingAlgorithmContentHandler) {
            setEncodingAlgorithmContentHandler((EncodingAlgorithmContentHandler)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY)) {
        if (value instanceof PrimitiveTypeContentHandler) {
            setPrimitiveTypeContentHandler((PrimitiveTypeContentHandler)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.BUFFER_SIZE_PROPERTY)) {
        if (value instanceof Integer) {
            setBufferSize(((Integer)value).intValue());
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.BUFFER_SIZE_PROPERTY);
        }
    } else {
        throw new SAXNotRecognizedException(CommonResourceBundle.getInstance().
                getString("message.propertyNotRecognized", new Object[]{name}));
    }
}
 
源代码24 项目: hottub   文件: SAXDocumentParser.java
public void setDeclHandler(DeclHandler handler) {
    _declHandler = handler;
}
 
源代码25 项目: hottub   文件: SAXDocumentParser.java
public DeclHandler getDeclHandler() {
    return _declHandler;
}
 
源代码26 项目: openjdk-8-source   文件: SAXDocumentParser.java
public void setProperty(String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
        if (value instanceof LexicalHandler) {
            setLexicalHandler((LexicalHandler)value);
        } else {
            throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
        }
    } else if (name.equals(Properties.DTD_DECLARATION_HANDLER_PROPERTY)) {
        if (value instanceof DeclHandler) {
            setDeclHandler((DeclHandler)value);
        } else {
            throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY)) {
        if (value instanceof Map) {
            setExternalVocabularies((Map)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY)) {
        if (value instanceof Map) {
            setRegisteredEncodingAlgorithms((Map)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY)) {
        if (value instanceof EncodingAlgorithmContentHandler) {
            setEncodingAlgorithmContentHandler((EncodingAlgorithmContentHandler)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY)) {
        if (value instanceof PrimitiveTypeContentHandler) {
            setPrimitiveTypeContentHandler((PrimitiveTypeContentHandler)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.BUFFER_SIZE_PROPERTY)) {
        if (value instanceof Integer) {
            setBufferSize(((Integer)value).intValue());
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.BUFFER_SIZE_PROPERTY);
        }
    } else {
        throw new SAXNotRecognizedException(CommonResourceBundle.getInstance().
                getString("message.propertyNotRecognized", new Object[]{name}));
    }
}
 
源代码27 项目: openjdk-8-source   文件: SAXDocumentParser.java
public void setDeclHandler(DeclHandler handler) {
    _declHandler = handler;
}
 
源代码28 项目: openjdk-8-source   文件: SAXDocumentParser.java
public DeclHandler getDeclHandler() {
    return _declHandler;
}
 
源代码29 项目: ph-commons   文件: SAXReaderSettings.java
@Nonnull
public final SAXReaderSettings setDeclarationHandler (@Nullable final DeclHandler aDeclHandler)
{
  return setPropertyValue (EXMLParserProperty.SAX_DECLARATION_HANDLER, aDeclHandler);
}
 
源代码30 项目: openjdk-8   文件: SAXDocumentParser.java
public void setProperty(String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
        if (value instanceof LexicalHandler) {
            setLexicalHandler((LexicalHandler)value);
        } else {
            throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
        }
    } else if (name.equals(Properties.DTD_DECLARATION_HANDLER_PROPERTY)) {
        if (value instanceof DeclHandler) {
            setDeclHandler((DeclHandler)value);
        } else {
            throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY)) {
        if (value instanceof Map) {
            setExternalVocabularies((Map)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY)) {
        if (value instanceof Map) {
            setRegisteredEncodingAlgorithms((Map)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY)) {
        if (value instanceof EncodingAlgorithmContentHandler) {
            setEncodingAlgorithmContentHandler((EncodingAlgorithmContentHandler)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY)) {
        if (value instanceof PrimitiveTypeContentHandler) {
            setPrimitiveTypeContentHandler((PrimitiveTypeContentHandler)value);
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY);
        }
    } else if (name.equals(FastInfosetReader.BUFFER_SIZE_PROPERTY)) {
        if (value instanceof Integer) {
            setBufferSize(((Integer)value).intValue());
        } else {
            throw new SAXNotSupportedException(FastInfosetReader.BUFFER_SIZE_PROPERTY);
        }
    } else {
        throw new SAXNotRecognizedException(CommonResourceBundle.getInstance().
                getString("message.propertyNotRecognized", new Object[]{name}));
    }
}