本文整理了Java中javax.xml.soap.Node.detachNode()
方法的一些代码示例,展示了Node.detachNode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.detachNode()
方法的具体详情如下:
包路径:javax.xml.soap.Node
类名称:Node
方法名:detachNode
[英]Removes this Node
object from the tree.
[中]从树中删除此Node
对象。
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
/**
* Detaches all children of this SOAPElement.
* <p/>
* This method is useful for rolling back the construction of partially completed SOAPHeaders and SOAPBodys in
* preparation for sending a fault when an error condition is detected.
* It is also useful for recycling portions of a document within a SOAP message.
*/
public void removeContents()
{
Iterator<org.w3c.dom.Node> it = getChildElements();
while (it.hasNext())
{
Node el = (Node)it.next();
el.detachNode();
}
}
代码示例来源:origin: org.springframework.ws/spring-ws-core
@SuppressWarnings("unchecked")
@Override
public void removeHeaderElement(QName name) throws SoapHeaderException {
Iterator<Node> iterator = getSaajHeader().getChildElements(name);
if (iterator.hasNext()) {
Node element = iterator.next();
element.detachNode();
}
}
代码示例来源:origin: apache/servicemix-bundles
@SuppressWarnings("unchecked")
@Override
public void removeHeaderElement(QName name) throws SoapHeaderException {
Iterator<Node> iterator = getSaajHeader().getChildElements(name);
if (iterator.hasNext()) {
Node element = iterator.next();
element.detachNode();
}
}
代码示例来源:origin: spring-projects/spring-ws
@SuppressWarnings("unchecked")
@Override
public void removeHeaderElement(QName name) throws SoapHeaderException {
Iterator<Node> iterator = getSaajHeader().getChildElements(name);
if (iterator.hasNext()) {
Node element = iterator.next();
element.detachNode();
}
}
代码示例来源:origin: apache/servicemix-bundles
firstBodyElement.detachNode();
代码示例来源:origin: net.sourceforge.addressing/addressing
/**
* Removes all child elements from the specified
* {@link javax.xml.soap.SOAPElement}.
*
* @param soapElem Element to strip
*/
protected static void removeAllChildElements(SOAPElement soapElem) {
Iterator<?> iter = soapElem.getChildElements();
// NOTE: Convert iterator to list to avoid ConcurrentModificationExceptions
// caused by modifying items in an iterator during iteration
List<?> children = toList(iter);
for (int i = 0; i < children.size(); i++) {
Node child = (Node) children.get(i);
if (child.getParentElement() != null) {
child.detachNode();
child.recycleNode();
}
}
}
代码示例来源:origin: stackoverflow.com
SOAPMessage message = MessageFactory.newInstance().createMessage();
SOAPHeader header = message.getSOAPHeader();
header.detachNode();
内容来源于网络,如有侵权,请联系作者删除!