org.apache.axiom.om.OMNode.insertSiblingAfter()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(62)

本文整理了Java中org.apache.axiom.om.OMNode.insertSiblingAfter()方法的一些代码示例,展示了OMNode.insertSiblingAfter()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OMNode.insertSiblingAfter()方法的具体详情如下:
包路径:org.apache.axiom.om.OMNode
类名称:OMNode
方法名:insertSiblingAfter

OMNode.insertSiblingAfter介绍

[英]Inserts a new sibling after the current node. The current node must have a parent for this operation to succeed. If the node to be inserted has a parent, then it will first be detached.
[中]在当前节点后插入新的同级节点。当前节点必须有父节点,此操作才能成功。如果要插入的节点有父节点,则首先将其分离。

代码示例

代码示例来源:origin: org.paxml/paxml-core

/**
 * Replace a node with another one.
 * 
 * @param oldNode
 *            old node
 * @param newNode
 *            new node
 * @return the old node that is detached
 */
public static OMNode replaceNode(OMNode oldNode, OMNode newNode) {
  oldNode.insertSiblingAfter(newNode);
  return oldNode.detach();
}

代码示例来源:origin: org.paxml/PaxmlCore

/**
 * Replace a node with another one.
 * 
 * @param oldNode
 *            old node
 * @param newNode
 *            new node
 * @return the old node that is detached
 */
public static OMNode replaceNode(OMNode oldNode, OMNode newNode) {
  oldNode.insertSiblingAfter(newNode);
  return oldNode.detach();
}

代码示例来源:origin: deegree/deegree3

om.detach();
prevSib.insertSiblingAfter( newEl );

代码示例来源:origin: wso2/wso2-synapse

public boolean mediate(MessageContext synCtx) {
  SynapseLog synLog = getLog(synCtx);
  OMNode replacement = (OMNode)synCtx.getProperty(property);
  OMNode node = target.selectOMNode(synCtx, synLog);
  node.insertSiblingAfter(replacement);
  node.detach();
  synCtx.setProperty(property, null);
  return true;
}

代码示例来源:origin: org.paxml/PaxmlCore

static void processExpressions(ITag tag, IParserContext context) {
  if (!(tag instanceof ExpressionTag)) {
    // make sure all text nodes are converted to <expression> tags
    OMElement ele = context.getElement();
    for (OMNode child : AxiomUtils.getNodes(ele)) {
      if (child.getType() == OMNode.TEXT_NODE) {
        OMText textNode = (OMText) child;
        String text = textNode.getText();
        if (StringUtils.isNotBlank(text)) {
          OMElement expTag = createExpressionTag(text, ele.getLineNumber());
          child.insertSiblingAfter(expTag);
          child.detach();
        }
      }
    }
  }
}

代码示例来源:origin: org.paxml/paxml-core

static void processExpressions(ITag tag, IParserContext context) {
  if (!(tag instanceof ExpressionTag)) {
    // make sure all text nodes are converted to <expression> tags
    OMElement ele = context.getElement();
    for (OMNode child : AxiomUtils.getNodes(ele)) {
      if (child.getType() == OMNode.TEXT_NODE) {
        OMText textNode = (OMText) child;
        String text = textNode.getText();
        if (StringUtils.isNotBlank(text)) {
          OMElement expTag = createExpressionTag(text, ele.getLineNumber());
          child.insertSiblingAfter(expTag);
          child.detach();
        }
      }
    }
  }
}

代码示例来源:origin: org.apache.synapse/synapse-core

((OMNode) o).detach();
} else if (resultValue instanceof OMNode) {
  ((OMNode) o).insertSiblingAfter((OMNode) resultValue);
  ((OMNode) o).detach();

代码示例来源:origin: wso2/wso2-synapse

((OMNode) o).detach();
} else if (resultValue instanceof OMNode) {
  ((OMNode) o).insertSiblingAfter((OMNode) resultValue);
  ((OMNode) o).detach();

代码示例来源:origin: org.apache.synapse/synapse-core

sourceNode.insertSiblingAfter(result);
sourceNode.detach();

代码示例来源:origin: wso2/wso2-synapse

sourceNode.insertSiblingAfter(result);
sourceNode.detach();

代码示例来源:origin: wso2/wso2-synapse

destination.insertSiblingAfter(resultOM);
destination.detach();

代码示例来源:origin: org.apache.synapse/synapse-extensions

if (resultOM != null) {
  destination.insertSiblingAfter(resultOM);
  destination.detach();

代码示例来源:origin: org.apache.synapse/synapse-core

if (o != null && o instanceof OMElement) {
  OMNode tgtNode = (OMElement) o;
  tgtNode.insertSiblingAfter(result);
  tgtNode.detach();
} else if (o != null && o instanceof List && !((List) o).isEmpty()) {
  tgtNode.insertSiblingAfter(result);
  tgtNode.detach();
} else {

代码示例来源:origin: org.apache.synapse/synapse-core

tgtNode.insertSiblingAfter(result);
  tgtNode.detach();
} else if (o != null && o instanceof List && !((List) o).isEmpty()) {
  tgtNode.insertSiblingAfter(result);
  tgtNode.detach();
} else {

代码示例来源:origin: wso2/wso2-synapse

if (o != null && o instanceof OMElement) {
  OMNode tgtNode = (OMElement) o;
  tgtNode.insertSiblingAfter(result);
  tgtNode.detach();
} else if (o != null && o instanceof List && !((List) o).isEmpty()) {
  tgtNode.insertSiblingAfter(result);
  tgtNode.detach();
} else {

相关文章