Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMNode.serialize()


    }

    public void testElementSerilizationChild() throws Exception {
        OMElement elt = builder.getDocumentElement();
        OMNode node = elt.getFirstOMChild().getNextOMSibling();
        node.serialize(writer);

    }

    public void testElementSerilizationSOAPBodyCacheOff() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
View Full Code Here


    }

    public void testElementSerilizationSOAPBodyCacheOff() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
        OMNode node = env.getBody();
        node.serialize(writer);
    }

    public void testElement() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
        SOAPBody body = env.getBody();
View Full Code Here

            OMNode omNode = (OMNode)it.next();
            // TODO Using serialize and consume
            // caused an axiom bug...falling back to serialize
            // (which is less performant due to om caching)
            //omNode.serializeAndConsume(writer);
            omNode.serialize(writer);
        }
        // Close the reader
        reader.close();
    }
View Full Code Here

            StringWriter out = new StringWriter();
            XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(out);
            writer.writeStartElement("");
            for (Iterator<?> nodes = this.getChildren(); nodes.hasNext();) {
                OMNode node = (OMNode)nodes.next();
                node.serialize(writer);
            }
            writer.writeEndElement();
            return out.getBuffer().toString().substring(2);
        } catch (Exception e) {
        }
View Full Code Here

      XMLStreamWriter writer =
        XMLOutputFactory.newInstance().createXMLStreamWriter(out);
      writer.writeStartElement("");
      for (Iterator<?> nodes = this.getChildren(); nodes.hasNext();) {
        OMNode node = (OMNode) nodes.next();
        node.serialize(writer);
      }
      writer.writeEndElement();
      return out.toString().substring(2);
    } catch (Exception e) {}
    return "";
View Full Code Here

            OMNode omNode = (OMNode)it.next();
            // TODO Using serialize and consume
            // caused an axiom bug...falling back to serialize
            // (which is less performant due to om caching)
            //omNode.serializeAndConsume(writer);
            omNode.serialize(writer);
        }
        // Close the reader if marked to do so
        if (closeReader) {
            if (log.isDebugEnabled()) {
                log.debug("closing reader, builder: " + JavaUtils.stackToString());
View Full Code Here

    }

    public void testElementSerilizationChild() throws Exception {
        OMElement elt = builder.getDocumentElement();
        OMNode node = elt.getFirstOMChild().getNextOMSibling();
        node.serialize(writer);

    }

    public void testElementSerilizationSOAPBodyCacheOff() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
View Full Code Here

    }

    public void testElementSerilizationSOAPBodyCacheOff() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
        OMNode node = env.getBody();
        node.serialize(writer);
    }

    public void testElement() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
        SOAPBody body = env.getBody();
View Full Code Here

    public static void serializeChildren(OMContainer container, XMLStreamWriter writer,
            boolean cache) throws XMLStreamException {
        if (cache) {
            OMNode child = container.getFirstOMChild();
            while (child != null) {
                child.serialize(writer, true);
                child = child.getNextOMSibling();
            }
        } else {
            OMNode child = (OMNodeEx)container.getFirstOMChild();
            while (child != null) {
View Full Code Here

        } else {
            OMNode child = (OMNodeEx)container.getFirstOMChild();
            while (child != null) {
                if ((!(child instanceof OMElement)) || child.isComplete() ||
                        ((OMElement)child).getBuilder() == null) {
                    child.serialize(writer, false);
                } else {
                    OMElement element = (OMElement) child;
                    element.getBuilder().setCache(false);
                    serializeByPullStream(element, writer, cache);
                }
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.