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

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

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

OMElement.detach介绍

暂无

代码示例

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

protected void removeSessionID(OMElement header, QName keyQName) {
  OMElement sgcIDElm = getHeaderBlock(header, keyQName);
  if (sgcIDElm != null) {
    sgcIDElm.detach();
  }
}

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

public void onMessage(org.apache.axis2.context.MessageContext messageContext) {
  System.out.println("Response received to the callback");
  OMElement result
      = messageContext.getEnvelope().getBody().getFirstElement();
  // Detach the result to make sure that the element we return to the sample client
  // is completely built
  result.detach();
  StockQuoteClient.InnerStruct.RESULT = result;
}

代码示例来源:origin: org.apache.airavata/airavata-workflow-tracking

public void setFromProperties(Properties props) {
  for (Iterator it = target.getChildElements(); it.hasNext();) {
    OMElement child = (OMElement) it.next();
    child.detach();
  }
  String key;
  String value;
  for (Iterator i = props.keySet().iterator(); i.hasNext(); setString(key, value)) {
    key = (String) i.next();
    value = props.getProperty(key);
  }
}

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

public void toSOAPEnvelope(SOAPEnvelope envelope) {
  SOAPBody body = envelope.getBody();
  
  //detach if already exist.
  OMElement elem = body.getFirstChildWithName(new QName(namespaceValue,
      Sandesha2Constants.WSRM_COMMON.TERMINATE_SEQUENCE));
  if (elem!=null)
    elem.detach();
  
  toOMElement(body);
}

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

public void toSOAPEnvelope(SOAPEnvelope envelope) throws AxisFault {
  SOAPBody body = envelope.getBody();
  
  //detach if already exist.
  OMElement elem = body.getFirstChildWithName(new QName(rmNamespaceValue,
      Sandesha2Constants.WSRM_COMMON.CREATE_SEQUENCE));
  if (elem!=null)
    elem.detach();
  
  toOMElement(body);
}

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

public void toSOAPEnvelope(SOAPEnvelope envelope) {
  SOAPBody body = envelope.getBody();
  
  //detach if already exist.
  OMElement elem = body.getFirstChildWithName(new QName(namespaceValue,
      Sandesha2Constants.WSRM_COMMON.CLOSE_SEQUENCE_RESPONSE));
  if (elem!=null)
    elem.detach();
  
  toOMElement(body);
}

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

public void toSOAPEnvelope(SOAPEnvelope envelope) {
  SOAPBody body = envelope.getBody();
  
  //detach if already exist.
  OMElement elem = body.getFirstChildWithName(new QName(namespaceValue,
      Sandesha2Constants.WSRM_COMMON.TERMINATE_SEQUENCE_RESPONSE));
  if (elem!=null)
    elem.detach();
  
  toOMElement(body);
}

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

public void toSOAPEnvelope(SOAPEnvelope envelope) {
  SOAPBody body = envelope.getBody();
  
  //detach if already exist.
  OMElement elem = body.getFirstChildWithName(new QName(namespaceValue,
      Sandesha2Constants.WSRM_COMMON.CLOSE_SEQUENCE));
  if (elem!=null)
    elem.detach();
  
  toOMElement(body);
}

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

public void toSOAPEnvelope(SOAPEnvelope envelope) throws AxisFault {
  SOAPBody body = envelope.getBody();
  
  //detach if already exist.
  OMElement elem = body.getFirstChildWithName(new QName(rmNamespaceValue,
      Sandesha2Constants.WSRM_COMMON.CREATE_SEQUENCE_RESPONSE));
  if (elem!=null)
    elem.detach();
  
  toOMElement(body);
}

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

public void toSOAPEnvelope(SOAPEnvelope envelope) {
  SOAPBody body = envelope.getBody();
  
  //detach if already exist.
  OMElement elem = body.getFirstChildWithName(new QName(Sandesha2Constants.SPEC_2007_02.MC_NS_URI,
      Sandesha2Constants.WSRM_COMMON.MAKE_CONNECTION));
  if (elem!=null)
    elem.detach();
  
  toOMElement(body);
}

代码示例来源:origin: usnistgov/iheos-toolkit2

public void rmObject(OMElement ele) {
  if (ele.getParent() != null)
    ele.detach();
  List<List<OMElement>> containers = this.get_metadata_containers();
  for (List<OMElement> container : containers)
    container.remove(ele);
}

代码示例来源:origin: wso2-attic/esb-connectors

public static void preparePayload(MessageContext messageContext, OMElement element) {
  SOAPBody soapBody = messageContext.getEnvelope().getBody();
  for (Iterator itr = soapBody.getChildElements(); itr.hasNext();) {
    OMElement child = (OMElement) itr.next();
    child.detach();
  }
  for (Iterator itr = element.getChildElements(); itr.hasNext();) {
    OMElement child = (OMElement) itr.next();
    soapBody.addChild(child);
  }
}

代码示例来源:origin: org.apache.ws.commons.axiom/axiom-impl

public OMElement getDocumentElement(boolean discardDocument) {
  OMElement documentElement = getDocument().getOMDocumentElement();
  if (discardDocument) {
    documentElement.detach();
  }
  return documentElement;
}

代码示例来源:origin: org.apache.ws.commons.axiom/om-aspects

public OMElement getDocumentElement(boolean discardDocument) {
  OMElement documentElement = getDocument().getOMDocumentElement();
  if (discardDocument) {
    documentElement.detach();
  }
  return documentElement;
}

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

private void buildLibraries(OMElement ele, boolean detach) {
  for (OMElement child : AxiomUtils.getElements(ele, "library")) {
    String className = child.getText().trim();
    if (StringUtils.isNotBlank(className)) {
      Class<? extends ITagLibrary> clazz = (Class<? extends ITagLibrary>) ReflectUtils.loadClassStrict(
          className, null);
      model.getConfig().getTagLibs().add(clazz);
    }
    if (detach) {
      child.detach();
    }
  }
}

代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.rulecep.adapters

private void handleFirstChild(OMElement firstChild,
                 OMElement result,
                 ResourceDescription description) {

    if (!firstChild.getQName().equals(description.getParentElementQName())) {
      firstChild.insertSiblingAfter(result);
      firstChild.detach();
    } else {
      firstChild.addChild(result);
    }
  }
}

代码示例来源:origin: org.springframework.ws/spring-ws-core

@Override
public void removeHeaderElement(QName name) throws SoapHeaderException {
  try {
    OMElement element = getAxiomHeader().getFirstChildWithName(name);
    if (element != null) {
      element.detach();
    }
  }
  catch (OMException ex) {
    throw new AxiomSoapHeaderException(ex);
  }
}

代码示例来源:origin: org.wso2.carbon.commons/org.wso2.carbon.reporting.template.core

private void refreshReport() throws JaxenException {
  AXIOMXPath xpathExpression = new AXIOMXPath("//a:title");
  xpathExpression.addNamespace("a", "http://jasperreports.sourceforge.net/jasperreports");
  OMElement documentElement = document.getOMDocumentElement();
  List nodeList = xpathExpression.selectNodes(documentElement);
  OMElement element = (OMElement) nodeList.get(0);
  element.detach();
}

代码示例来源:origin: org.springframework.ws/org.springframework.ws

public void removeHeaderElement(QName name) throws SoapHeaderException {
  try {
    OMElement element = getAxiomHeader().getFirstChildWithName(name);
    if (element != null) {
      element.detach();
    }
  }
  catch (OMException ex) {
    throw new AxiomSoapHeaderException(ex);
  }
}

代码示例来源:origin: org.wso2.carbon.appmgt/org.wso2.carbon.appmgt.gateway

public static void setFaultPayload(MessageContext messageContext, OMElement payload) {
  OMElement firstChild = messageContext.getEnvelope().getBody().getFirstElement();
  if (firstChild != null) {
    firstChild.insertSiblingAfter(payload);
    firstChild.detach();
  } else {
    messageContext.getEnvelope().getBody().addChild(payload);
  }        
}

相关文章

微信公众号

最新文章

更多