Digester.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:lazycat 作者:
/**
 * Return the SAXParserFactory we will use, creating one if necessary.
 * 
 * @throws ParserConfigurationException
 * @throws SAXNotSupportedException
 * @throws SAXNotRecognizedException
 */
public SAXParserFactory getFactory()
        throws SAXNotRecognizedException, SAXNotSupportedException, ParserConfigurationException {

    if (factory == null) {
        factory = SAXParserFactory.newInstance();

        factory.setNamespaceAware(namespaceAware);
        // Preserve xmlns attributes
        if (namespaceAware) {
            factory.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
        }

        factory.setValidating(validating);
        if (validating) {
            // Enable DTD validation
            factory.setFeature("http://xml.org/sax/features/validation", true);
            // Enable schema validation
            factory.setFeature("http://apache.org/xml/features/validation/schema", true);
        }
    }
    return (factory);

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号