本文整理匯總了Java中org.apache.axiom.om.OMElement.setNamespace方法的典型用法代碼示例。如果您正苦於以下問題:Java OMElement.setNamespace方法的具體用法?Java OMElement.setNamespace怎麽用?Java OMElement.setNamespace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.axiom.om.OMElement
的用法示例。
在下文中一共展示了OMElement.setNamespace方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: formatResponse
import org.apache.axiom.om.OMElement; //導入方法依賴的package包/類
/**
* Format the sent in response as required by OpenSAML
*
* @param xacmlResponse : received XACML response
* @return formatted response
*/
private String formatResponse(String xacmlResponse) throws Exception {
xacmlResponse = xacmlResponse.replace("\n", "");
OMElement omElemnt;
try {
omElemnt = org.apache.axiom.om.util.AXIOMUtil.stringToOM(xacmlResponse);
omElemnt.setNamespace(xacmlContextNS);
if (omElemnt.getChildren() != null) {
Iterator childIterator = omElemnt.getChildElements();
setXACMLNamespace(childIterator);
}
} catch (Exception e) {
log.error("Error while generating the OMElement from the XACML request.", e);
throw new Exception("Error while generating the OMElement from the XACML request.", e);
}
return omElemnt.toString();
}
示例2: setXACMLNamespace
import org.apache.axiom.om.OMElement; //導入方法依賴的package包/類
/**
* Set relevant xacml namespace to all the children in the given iterator. *
*
* @param iterator: Iterator for all children inside OMElement
*/
private static void setXACMLNamespace(Iterator iterator) {
while (iterator.hasNext()) {
OMElement omElement2 = (OMElement) iterator.next();
omElement2.setNamespace(xacmlContextNS);
if (omElement2.getChildElements().hasNext()) {
setXACMLNamespace(omElement2.getChildElements());
}
}
}