本文整理汇总了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);
}
示例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);
}
示例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();
}
}
示例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;
}