Examples of OMNodeEx


Examples of org.apache.axiom.om.impl.OMNodeEx

       
        return reader;
    }
   
    public static void addChild(IContainer container, OMNode omNode, boolean fromBuilder) {
        OMNodeEx child;
        if (fromBuilder) {
            // If the new child was provided by the builder, we know that it was created by
            // the same factory
            child = (OMNodeEx)omNode;
        } else {
            // Careful here: if the child was created by another Axiom implementation, it doesn't
            // necessarily implement OMNodeEx
            if (omNode.getOMFactory().getMetaFactory() == container.getOMFactory().getMetaFactory()) {
                child = (OMNodeEx)omNode;
            } else {
                child = (OMNodeEx)((OMFactoryEx)container.getOMFactory()).importNode(omNode);
            }
            if (!container.isComplete()) {
                container.build();
            }
            if (child.getParent() == container && child == container.getLastKnownOMChild()) {
                // The child is already the last node.
                // We don't need to detach and re-add it.
                return;
            }
        }
        if (child.getParent() != null) {
            child.detach();
        }
       
        child.setParent(container);

        if (container.getFirstOMChildIfAvailable() == null) {
            container.setFirstChild(child);
        } else {
            OMNode lastChild = container.getLastKnownOMChild();
            child.setPreviousOMSibling(lastChild);
            ((OMNodeEx)lastChild).setNextOMSibling(child);
        }
        container.setLastChild(child);

        // For a normal OMNode, the incomplete status is
        // propogated up the tree. 
        // However, a OMSourcedElement is self-contained
        // (it has an independent parser source).
        // So only propogate the incomplete setting if this
        // is a normal OMNode
        if (!fromBuilder && !child.isComplete() &&
            !(child instanceof OMSourcedElement)) {
            container.setComplete(false);
        }
    }
View Full Code Here

Examples of org.apache.axiom.om.impl.OMNodeEx

            Iterator children = container.getChildren();
            while (children.hasNext()) {
                ((OMNodeEx) children.next()).internalSerialize(writer, true);
            }
        } else {
            OMNodeEx child = (OMNodeEx)container.getFirstOMChild();
            while (child != null) {
                if ((!(child instanceof OMElement)) || child.isComplete() ||
                        ((OMElement)child).getBuilder() == null) {
                    child.internalSerialize(writer, false);
                } else {
                    OMElement element = (OMElement) child;
                    element.getBuilder().setCache(false);
                    serializeByPullStream(element, writer, cache);
                }
                child = (OMNodeEx)child.getNextOMSiblingIfAvailable();
            }
        }
    }
View Full Code Here

Examples of org.apache.axiom.om.impl.OMNodeEx

        return node;
    }

    protected void endElement() {
        if (lastNode.isComplete()) {
            OMNodeEx parent = (OMNodeEx) lastNode.getParent();
            parent.setComplete(true);
            lastNode = parent;
        } else {
            OMNodeEx e = (OMNodeEx) lastNode;
            e.setComplete(true);
        }

        //return lastNode;
    }
View Full Code Here

Examples of org.apache.axiom.om.impl.OMNodeEx

    }

    public OMElement getDocumentElement(boolean discardDocument) {
        OMElement element = document.getOMDocumentElement();
        if (discardDocument) {
            OMNodeEx nodeEx = (OMNodeEx)element;
            nodeEx.setParent(null);
            nodeEx.setPreviousOMSibling(null);
            nodeEx.setNextOMSibling(null);
        }
        return element;
    }
View Full Code Here

Examples of org.apache.axiom.om.impl.OMNodeEx

    }

    public OMElement getDocumentElement(boolean discardDocument) {
        OMElement element = getDocument().getOMDocumentElement();
        if (discardDocument) {
            OMNodeEx nodeEx = (OMNodeEx)element;
            nodeEx.setParent(null);
            nodeEx.setPreviousOMSibling(null);
            nodeEx.setNextOMSibling(null);
        }
        return element;
    }
View Full Code Here

Examples of org.apache.axiom.om.impl.OMNodeEx

        Iterator children = this.getChildren();

        if (cache) {
            while (children.hasNext()) {
                OMNodeEx omNode = (OMNodeEx) children.next();
                omNode.internalSerialize(writer);
            }
        } else {
            while (children.hasNext()) {
                OMNodeEx omNode = (OMNodeEx) children.next();
                omNode.internalSerializeAndConsume(writer);
            }
        }
    }
View Full Code Here

Examples of org.apache.axiom.om.impl.OMNodeEx

        return node;
    }

    protected void endElement() {
        if (lastNode.isComplete()) {
            OMNodeEx parent = (OMNodeEx) lastNode.getParent();
            parent.setComplete(true);
            lastNode = parent;
        } else {
            OMNodeEx e = (OMNodeEx) lastNode;
            e.setComplete(true);
        }

        //return lastNode;
    }
View Full Code Here

Examples of org.apache.axiom.om.impl.OMNodeEx

        Iterator children = this.getChildren();

        if (cache) {
            while (children.hasNext()) {
                OMNodeEx omNode = (OMNodeEx) children.next();
                omNode.internalSerialize(writer);
            }
        } else {
            while (children.hasNext()) {
                OMNodeEx omNode = (OMNodeEx) children.next();
                omNode.internalSerializeAndConsume(writer);
            }
        }
    }
View Full Code Here

Examples of org.apache.axiom.om.impl.OMNodeEx

        Iterator children = this.getChildren();

        if (cache) {
            while (children.hasNext()) {
                OMNodeEx omNode = (OMNodeEx) children.next();
                omNode.internalSerialize(writer);
            }
        } else {
            while (children.hasNext()) {
                OMNodeEx omNode = (OMNodeEx) children.next();
                omNode.internalSerializeAndConsume(writer);
            }
        }
    }
View Full Code Here

Examples of org.apache.axiom.om.impl.OMNodeEx

                    } else {
                        xmlReader = StAXUtils.createXMLStreamReader(StAXParserConfiguration.SOAP,
                                pushbackInputStream, (String) messageContext.getProperty(Constants.Configuration.CHARACTER_SET_ENCODING));
                    }
                    StAXBuilder builder = new StAXOMBuilder(xmlReader);
                    OMNodeEx documentElement = (OMNodeEx) builder.getDocumentElement();
                    documentElement.setParent(null);
                    SOAPBody body = soapEnvelope.getBody();
                    body.addChild(documentElement);

                }
            } catch (XMLStreamException e) {
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.