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