当前位置: 首页>>代码示例>>Java>>正文


Java XmlFactory.createDocumentBuilderFactory方法代码示例

本文整理汇总了Java中com.sun.xml.internal.bind.v2.util.XmlFactory.createDocumentBuilderFactory方法的典型用法代码示例。如果您正苦于以下问题:Java XmlFactory.createDocumentBuilderFactory方法的具体用法?Java XmlFactory.createDocumentBuilderFactory怎么用?Java XmlFactory.createDocumentBuilderFactory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.xml.internal.bind.v2.util.XmlFactory的用法示例。


在下文中一共展示了XmlFactory.createDocumentBuilderFactory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ResultImpl

import com.sun.xml.internal.bind.v2.util.XmlFactory; //导入方法依赖的package包/类
ResultImpl() {
    try {
        DocumentBuilderFactory factory = XmlFactory.createDocumentBuilderFactory(false); // safe - only used for BI
        s2d = new SAX2DOMEx(factory);
    } catch (ParserConfigurationException e) {
        throw new AssertionError(e);    // impossible
    }

    XMLFilterImpl f = new XMLFilterImpl() {
        @Override
        public void setDocumentLocator(Locator locator) {
            super.setDocumentLocator(locator);
            location = new LocatorImpl(locator);
        }
    };
    f.setContentHandler(s2d);

    setHandler(f);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:DomHandlerEx.java

示例2: SAX2DOMEx

import com.sun.xml.internal.bind.v2.util.XmlFactory; //导入方法依赖的package包/类
/**
 * Creates a fresh empty DOM document and adds nodes under this document.
 * @deprecated
 */
public SAX2DOMEx() throws ParserConfigurationException {
    DocumentBuilderFactory factory = XmlFactory.createDocumentBuilderFactory(false);
    factory.setValidating(false);

    document = factory.newDocumentBuilder().newDocument();
    node = document;
    nodeStack.push(document);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:SAX2DOMEx.java

示例3: createDom

import com.sun.xml.internal.bind.v2.util.XmlFactory; //导入方法依赖的package包/类
/**
 * Creates a new DOM document.
 */
static Document createDom(boolean disableSecurityProcessing) {
    synchronized(JAXBContextImpl.class) {
        if(db==null) {
            try {
                DocumentBuilderFactory dbf = XmlFactory.createDocumentBuilderFactory(disableSecurityProcessing);
                db = dbf.newDocumentBuilder();
            } catch (ParserConfigurationException e) {
                // impossible
                throw new FactoryConfigurationError(e);
            }
        }
        return db.newDocument();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:JAXBContextImpl.java

示例4: DOMForest

import com.sun.xml.internal.bind.v2.util.XmlFactory; //导入方法依赖的package包/类
public DOMForest( InternalizationLogic logic, Options opt ) {

        if (opt == null) throw new AssertionError("Options object null");
        this.options = opt;

        try {
            DocumentBuilderFactory dbf = XmlFactory.createDocumentBuilderFactory(opt.disableXmlSecurity);
            this.documentBuilder = dbf.newDocumentBuilder();
            this.parserFactory = XmlFactory.createParserFactory(opt.disableXmlSecurity);
        } catch( ParserConfigurationException e ) {
            throw new AssertionError(e);
        }

        this.logic = logic;
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:DOMForest.java


注:本文中的com.sun.xml.internal.bind.v2.util.XmlFactory.createDocumentBuilderFactory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。