Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMElement.detach()


        OMElement existingDocumentElement = getOMDocumentElement();
        if (existingDocumentElement == null) {
            addChild(documentElement);
        } else {
            OMNode nextSibling = existingDocumentElement.getNextOMSibling();
            existingDocumentElement.detach();
            if (nextSibling == null) {
                addChild(documentElement);
            } else {
                nextSibling.insertSiblingBefore(documentElement);
            }
View Full Code Here


                          OMNode child = (OMNode)children.next();
                          child.detach();
                          header.addChild(child);
                        }
                       
                        element.detach();
                       
                        soapHeader.build();
                       
                        header.setProcessed();
                       
View Full Code Here

        }
        OMElement a = (OMElement)root.getFirstOMChild();
        assertEquals("a", a.getLocalName());
        OMElement b = (OMElement)a.getNextOMSibling();
        assertEquals("b", b.getLocalName());
        b.detach();
        assertNull(b.getParent());
        OMElement c = (OMElement)a.getNextOMSibling();
        assertEquals("c", c.getLocalName());
        assertSame(c, a.getNextOMSibling());
        assertSame(a, c.getPreviousOMSibling());
View Full Code Here

   
    //detach if already exist.
    OMElement elem = header.getFirstChildWithName(new QName(
        namespaceValue, Sandesha2Constants.WSRM_COMMON.USES_SEQUENCE_STR));
    if (elem != null)
      elem.detach();

    toOMElement(header);
  }

  public boolean isNamespaceSupported (String namespaceName) {
View Full Code Here

        factory.createOMElement("child2", null, parent);
        factory.createOMElement("child3", null, parent);
        Iterator it = parent.getChildren();
        it.next();
        OMElement child2 = (OMElement)it.next();
        child2.detach();
        try {
            it.next();
            fail("Expected ConcurrentModificationException");
        } catch (ConcurrentModificationException ex) {
            // Expected
View Full Code Here

        factory.createOMElement("child2", null, parent);
        factory.createOMElement("child3", null, parent);
        Iterator it = parent.getChildElements();
        it.next();
        OMElement child2 = (OMElement)it.next();
        child2.detach();
        try {
            it.next();
            fail("Expected ConcurrentModificationException");
        } catch (ConcurrentModificationException ex) {
            // Expected
View Full Code Here

        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;
    }

    public void onFault(org.apache.axis2.context.MessageContext messageContext) {
        System.out.println("Fault received to the callback : " + messageContext.getEnvelope().
View Full Code Here

        // Forces the parser to read all of the blocks
        getNumBodyBlocks();

        OMElement om = this._getChildOMElement(_getBodyBlockParent(), index);
        if (om != null) {
            om.detach();
        }
    }

    public int getNumHeaderBlocks() throws WebServiceException {
        return _getNumChildElements(root.getHeader());
View Full Code Here

        OMElement om = this._getChildOMElement(root.getHeader(), namespace, localPart);
        if (om == null) {
            root.getOrCreateHeader().addChild(newOM);
        } else {
            om.insertSiblingBefore(newOM);
            om.detach();
        }
    }
   
    public void appendHeaderBlock(String namespace, String localPart, Block block)
    throws WebServiceException {
View Full Code Here


    public void removeHeaderBlock(String namespace, String localPart) throws WebServiceException {
        OMElement om = this._getChildOMElement(root.getHeader(), namespace, localPart);
        while (om != null) {
            om.detach();
            om = this._getChildOMElement(root.getHeader(), namespace, localPart);
        }
    }

    public String traceString(String indent) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.