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