當前位置: 首頁>>代碼示例>>Java>>正文


Java TransformerConfigurationException.printStackTrace方法代碼示例

本文整理匯總了Java中javax.xml.transform.TransformerConfigurationException.printStackTrace方法的典型用法代碼示例。如果您正苦於以下問題:Java TransformerConfigurationException.printStackTrace方法的具體用法?Java TransformerConfigurationException.printStackTrace怎麽用?Java TransformerConfigurationException.printStackTrace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.xml.transform.TransformerConfigurationException的用法示例。


在下文中一共展示了TransformerConfigurationException.printStackTrace方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: save

import javax.xml.transform.TransformerConfigurationException; //導入方法依賴的package包/類
public static void save(String paramString, Document paramDocument) throws Exception {
	DOMSource localDOMSource = new DOMSource(paramDocument);
	File localFile1 = new File(paramString);
	File localFile2 = localFile1.getParentFile();
	localFile2.mkdirs();
	StreamResult localStreamResult = new StreamResult(localFile1);
	try {
		TransformerFactory localTransformerFactory = TransformerFactory.newInstance();
		Transformer localTransformer = localTransformerFactory.newTransformer();
		Properties localProperties = localTransformer.getOutputProperties();
		localProperties.setProperty("encoding", "UTF-8");
		localProperties.setProperty("indent", "yes");
		localTransformer.setOutputProperties(localProperties);
		localTransformer.transform(localDOMSource, localStreamResult);
	} catch (TransformerConfigurationException localTransformerConfigurationException) {
		localTransformerConfigurationException.printStackTrace();
	} catch (TransformerException localTransformerException) {
		localTransformerException.printStackTrace();
	}
}
 
開發者ID:inspingcc,項目名稱:LibraSock,代碼行數:21,代碼來源:XmlUtils.java

示例2: setServiceDescriptionName

import javax.xml.transform.TransformerConfigurationException; //導入方法依賴的package包/類
/**
 * Sets the service description name.
 *
 * @param serviceDescriptionFile the service description file
 * @param serviceName the service name
 */
private void setServiceDescriptionName(File serviceDescriptionFile) {
	
	String newServiceName = this.getSymbolicBundleName() + "." + CLASS_LOAD_SERVICE_NAME;
	
	try {
		// --- Open the XML document ------------------
		DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
		DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
		Document doc = docBuilder.parse(serviceDescriptionFile);
		
		// --- Get the XML root/component element -----
		Node component = doc.getFirstChild();
		NamedNodeMap componentAttr = component.getAttributes();
		Node nameAttr = componentAttr.getNamedItem("name");
		nameAttr.setTextContent(newServiceName);
		
		// --- Save document in XML file --------------	
		TransformerFactory transformerFactory = TransformerFactory.newInstance();
		Transformer transformer = transformerFactory.newTransformer();
		DOMSource source = new DOMSource(doc);
		StreamResult result = new StreamResult(serviceDescriptionFile);
		transformer.transform(source, result);
		
	} catch (ParserConfigurationException pcEx) {
		pcEx.printStackTrace();
	} catch (SAXException saxEx) {
		saxEx.printStackTrace();
	} catch (IOException ioEx) {
		ioEx.printStackTrace();
	} catch (TransformerConfigurationException tcEx) {
		tcEx.printStackTrace();
	} catch (TransformerException tEx) {
		tEx.printStackTrace();
	}
	
}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:43,代碼來源:BundleBuilder.java

示例3: initalize

import javax.xml.transform.TransformerConfigurationException; //導入方法依賴的package包/類
@Override
public void initalize(WitsmlClient witsmlClient, String wellId, String wellboreId) {
    try {
        transformer = new WitsmlVersionTransformer();
    } catch (TransformerConfigurationException e) {
        e.printStackTrace();
    }
    this.witsmlClient = witsmlClient;
    this.wellId = wellId;
    this.wellboreId = wellboreId;
}
 
開發者ID:hashmapinc,項目名稱:witsml-client,代碼行數:12,代碼來源:TrajectoryRequestTracker.java


注:本文中的javax.xml.transform.TransformerConfigurationException.printStackTrace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。