本文整理汇总了Java中javax.xml.parsers.FactoryConfigurationError.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java FactoryConfigurationError.printStackTrace方法的具体用法?Java FactoryConfigurationError.printStackTrace怎么用?Java FactoryConfigurationError.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.xml.parsers.FactoryConfigurationError
的用法示例。
在下文中一共展示了FactoryConfigurationError.printStackTrace方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDOM
import javax.xml.parsers.FactoryConfigurationError; //导入方法依赖的package包/类
/**
* Creates a DOM (Document Object Model) <code>Document<code>.
*/
private void createDOM() {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
//data is a Document
Document data = builder.newDocument();
Element root = data.createElement("measure");
root.setAttribute("name", name);
root.setAttribute("meanValue", "null");
root.setAttribute("upperBound", "null");
root.setAttribute("lowerBound", "null");
root.setAttribute("progress", Double.toString(getSamplesAnalyzedPercentage()));
root.setAttribute("data", "null");
root.setAttribute("finished", "false");
root.setAttribute("discarded", "0");
root.setAttribute("precision", Double.toString(analyzer.getPrecision()));
root.setAttribute("maxSamples", Double.toString(getMaxSamples()));
data.appendChild(root);
} catch (FactoryConfigurationError factoryConfigurationError) {
factoryConfigurationError.printStackTrace();
} catch (ParserConfigurationException e) {
e.printStackTrace();
}
}
示例2: parseFile
import javax.xml.parsers.FactoryConfigurationError; //导入方法依赖的package包/类
public boolean parseFile(InputSource var1) {
try {
this.init();
SAXParserFactory var2 = SAXParserFactory.newInstance();
var2.setValidating(false);
SAXParser var3 = var2.newSAXParser();
var3.parse(var1, this);
return true;
} catch (FactoryConfigurationError var4) {
var4.printStackTrace();
} catch (ParserConfigurationException var5) {
var5.printStackTrace();
} catch (SAXException var6) {
var6.printStackTrace();
} catch (IOException var7) {
;
}
return false;
}
示例3: getDocument
import javax.xml.parsers.FactoryConfigurationError; //导入方法依赖的package包/类
/**
* Create and return a new xml DOM object parsed from the argument <code>URL</code>
*
* @param url the document <code>URL</code>
* @return a new xml DOM object parsed from the argument <code>URL</code>, or
* <code>null</code> if one cannot be created.
*/
public static Document getDocument(URL url) {
Document document = null;
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.parse(url.openStream());
}
// unable to get a document builder factory
catch (FactoryConfigurationError fce) {
fce.printStackTrace();
}
// Parser with specified options can't be built
catch (ParserConfigurationException pce) {
pce.printStackTrace();
}
// Errors generated during parsing
catch (SAXException sxe) {
sxe.printStackTrace();
}
catch (IOException ioe) {
ioe.printStackTrace();
}
return(document);
}
示例4: createDOM
import javax.xml.parsers.FactoryConfigurationError; //导入方法依赖的package包/类
/**
* Creates a DOM (Document Object Model) <code>Document<code> for XMLMeasureOutput.
*/
private void createDOM() {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
//data is a Document
document = builder.newDocument();
root = document.createElement("measureOutput");
root.setAttribute("name", name);
root.setAttribute("precision", Double.toString(measure.getAnalyzer().getPrecision()));
root.setAttribute("alfa", Double.toString(measure.getAnalyzer().getAlfa()));
root.setAttribute("maxSamples", Integer.toString(measure.getMaxSamples()));
report = document.createElement("report");
report.setAttribute("meanValue", "null");
report.setAttribute("upperBound", "null");
report.setAttribute("lowerBound", "null");
report.setAttribute("finished", "false");
report.setAttribute("successful", "false");
report.setAttribute("isZero", "false");
report.setAttribute("analyzedSamples", "0");
report.setAttribute("discardedSamples", "0");
root.appendChild(report);
samples = document.createElement("samples");
} catch (FactoryConfigurationError factoryConfigurationError) {
factoryConfigurationError.printStackTrace();
} catch (ParserConfigurationException e) {
e.printStackTrace();
}
}
示例5: createDOM
import javax.xml.parsers.FactoryConfigurationError; //导入方法依赖的package包/类
/**
* Creates a DOM (Document Object Model) <code>Document<code>.
*/
private void createDOM() {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
//data is a Document
data = builder.newDocument();
Element root = data.createElement("measure");
root.setAttribute("name", name);
root.setAttribute("meanValue", "null");
root.setAttribute("upperBound", "null");
root.setAttribute("lowerBound", "null");
root.setAttribute("progress", Double.toString(getSamplesAnalyzedPercentage()));
root.setAttribute("data", "null");
root.setAttribute("finished", "false");
root.setAttribute("discarded", "0");
root.setAttribute("precision", Double.toString(analyzer.getPrecision()));
root.setAttribute("maxSamples", Double.toString(getMaxSamples()));
data.appendChild(root);
} catch (FactoryConfigurationError factoryConfigurationError) {
factoryConfigurationError.printStackTrace();
} catch (ParserConfigurationException e) {
e.printStackTrace();
}
}
示例6: createDOM
import javax.xml.parsers.FactoryConfigurationError; //导入方法依赖的package包/类
/**
* Creates a DOM (Document Object Model) <code>Document<code> for XMLMeasureOutput.
*/
private void createDOM() {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
//data is a Document
document = builder.newDocument();
root = document.createElement("measureOutput");
root.setAttribute("name", name);
root.setAttribute("precision", Double.toString(measure.getAnalyzer().getPrecision()));
root.setAttribute("alfa", Double.toString(measure.getAnalyzer().getAlfa()));
root.setAttribute("maxSamples", Integer.toString(measure.getMaxSamples()));
report = document.createElement("report");
report.setAttribute("meanValue", "null");
report.setAttribute("upperBound", "null");
report.setAttribute("lowerBound", "null");
report.setAttribute("finished", "false");
report.setAttribute("successful", "false");
report.setAttribute("isZero", "false");
report.setAttribute("analyzedSamples", "0");
report.setAttribute("discardedSamples", "0");
root.appendChild(report);
samples = document.createElement("samples");
} catch (FactoryConfigurationError factoryConfigurationError) {
factoryConfigurationError.printStackTrace();
} catch (ParserConfigurationException e) {
e.printStackTrace();
}
}
示例7: XmlParser
import javax.xml.parsers.FactoryConfigurationError; //导入方法依赖的package包/类
/**
* Constructor allowing DTD validation of documents.
*
* @param resolver An entity resolver to use if validation is enabled.
* @see #setValidating(boolean)
*/
public XmlParser(EntityResolver resolver) {
this.entityResolver = resolver;
result = new DefaultParseResult(this);
try {
spf = SAXParserFactory.newInstance();
} catch (FactoryConfigurationError fce) {
fce.printStackTrace();
}
}
示例8: XmlParser
import javax.xml.parsers.FactoryConfigurationError; //导入方法依赖的package包/类
/**
* Constructor allowing DTD validation of documents.
*
* @param resolver An entity resolver to use if validation is enabled.
* @see #setValidating(boolean)
*/
public XmlParser(EntityResolver resolver) {
this.entityResolver = resolver;
result = new DefaultParseResult(this);
try {
spf = SAXParserFactory.newInstance();
} catch (FactoryConfigurationError fce) {
fce.printStackTrace();
}
}
示例9: XMLParser
import javax.xml.parsers.FactoryConfigurationError; //导入方法依赖的package包/类
public XMLParser(RSyntaxTextArea textArea) {
this.textArea = textArea;
result = new DefaultParseResult(this);
try {
spf = SAXParserFactory.newInstance();
} catch (FactoryConfigurationError fce) {
fce.printStackTrace();
}
}
示例10: XmlParser
import javax.xml.parsers.FactoryConfigurationError; //导入方法依赖的package包/类
public XmlParser(XmlLanguageSupport xls) {
this.xls = xls;
support = new PropertyChangeSupport(this);
try {
spf = SAXParserFactory.newInstance();
} catch (FactoryConfigurationError fce) {
fce.printStackTrace();
}
}