本文整理匯總了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();
}
}