XMLType.java 文件源码

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

项目:teiid 作者:
private static XMLInputFactory createXMLInputFactory()
        throws FactoryConfigurationError {
    XMLInputFactory factory = XMLInputFactory.newInstance();
    if (!SUPPORT_DTD) {
        factory.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
        //these next ones are somewhat redundant, we set them just in case the DTD support property is not respected
        factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
        factory.setXMLResolver(new XMLResolver() {

            @Override
            public Object resolveEntity(String arg0, String arg1, String arg2,
                    String arg3) throws XMLStreamException {
                throw new XMLStreamException("Reading external entities is disabled"); //$NON-NLS-1$
            }
        });
    }
    return factory;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号