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


Java XMLUtils類代碼示例

本文整理匯總了Java中org.apache.cxf.helpers.XMLUtils的典型用法代碼示例。如果您正苦於以下問題:Java XMLUtils類的具體用法?Java XMLUtils怎麽用?Java XMLUtils使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: printXmlFragment

import org.apache.cxf.helpers.XMLUtils; //導入依賴的package包/類
public static void printXmlFragment(XMLStreamReader reader) {
    try {
        LOG.info(XMLUtils.toString(StaxUtils.read(reader), 4));
    } catch (XMLStreamException e) {
        LOG.severe(e.getMessage());
    }
}
 
開發者ID:beemsoft,項目名稱:techytax-zk,代碼行數:8,代碼來源:StaxUtils.java

示例2: readParams

import org.apache.cxf.helpers.XMLUtils; //導入依賴的package包/類
/**
 * A helper method for reading a params block from a file. This is intended
 * to be used to pull in a skeleton registration block by a service prior to
 * populating any run-time defined fields.
 * 
 * @since GT3.9.5
 */

static public ServiceGroupRegistrationParameters readParams(String filename)
		throws Exception {
	InputStream inputStream = null;

	try {
		inputStream = new FileInputStream(filename);
		Document doc = XMLUtils.parse(inputStream);

		ServiceGroupRegistrationParameters params = null;

		JAXBContext jc = JAXBContext
				.newInstance(ServiceGroupRegistrationParameters.class);
		Unmarshaller u = jc.createUnmarshaller();

		DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
		dbf.setNamespaceAware(true);
		DocumentBuilder db = dbf.newDocumentBuilder();

		params = (ServiceGroupRegistrationParameters) u.unmarshal(doc);
		return params;
	} finally {
		if (inputStream != null) {
			inputStream.close();
		}
	}
}
 
開發者ID:NCIP,項目名稱:cagrid2,代碼行數:35,代碼來源:ServiceGroupRegistrator.java


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