Package org.apache.ws.commons.om.impl.builder

Examples of org.apache.ws.commons.om.impl.builder.StAXOMBuilder


     */
    public OMElement buildOM() throws XMLStreamException {
        XMLStreamReader xmlReader =
                XMLInputFactory.newInstance().createXMLStreamReader(descriptionStream);
        OMFactory fac = OMAbstractFactory.getOMFactory();
        StAXOMBuilder staxOMBuilder = new StAXOMBuilder(fac, xmlReader);
        OMElement element = staxOMBuilder.getDocumentElement();

        element.build();

        return element;
    }
View Full Code Here


     * @param xmlStreamReader
     * @param nameToMatch
     */
    public NamedStaxOMBuilder(XMLStreamReader xmlStreamReader, QName nameToMatch) {
        reader = xmlStreamReader;
        builder = new StAXOMBuilder(xmlStreamReader);
        this.nameToMatch = nameToMatch;
    }
View Full Code Here

        }
        return elemnts;
    }

    private OMElement elementClone(OMElement ele){
        return  new StAXOMBuilder(ele.getXMLStreamReader()).getDocumentElement();
    }
View Full Code Here

            }
            argCount ++;
        }

        XMLStreamReader xr = ADBPullParser.createPullParser(opName, objects.toArray(), null);
        StAXOMBuilder stAXOMBuilder =
                OMXMLBuilderFactory.createStAXOMBuilder(
                        OMAbstractFactory.getSOAP11Factory(), xr);
        return stAXOMBuilder.getDocumentElement();
    }
View Full Code Here

                    .getMessage("unsupportedType"));
        }
    }

    protected OMElement getElementFromReader(XMLStreamReader reader) {
        StAXOMBuilder builder =
                OMXMLBuilderFactory.createStAXOMBuilder(OMAbstractFactory.getOMFactory(), reader);

        return builder.getDocumentElement();
    }
View Full Code Here

        // this still has some namespace problem. Need to fix this.

    }

    private String getStringXML(XMLStreamReader reader) {
        OMElement omelement = new StAXOMBuilder(reader).getDocumentElement();
        return omelement.toString();
    }
View Full Code Here

    public static OMElement convertToanyType(String s) {
        try {
            XMLStreamReader r = XMLInputFactory.newInstance().createXMLStreamReader(
                    new ByteArrayInputStream(s.getBytes()));
            StAXOMBuilder builder = new StAXOMBuilder(OMAbstractFactory.getOMFactory(),r);
            return builder.getDocumentElement();
        } catch (XMLStreamException e) {
            return null;
        }
    }
View Full Code Here

                                // the SOAP Action is absent it is rest !!
                                msgContext.setDoingREST(true);

                                SOAPFactory soapFactory = new SOAP11Factory();

                                builder = new StAXOMBuilder(xmlreader);
                                builder.setOmbuilderFactory(soapFactory);
                                envelope = soapFactory.getDefaultEnvelope();
                                envelope.getBody().addChild(builder.getDocumentElement());
                            }
                        } else {
View Full Code Here

            } else if (msgContext.isDoingREST()) {
                XMLStreamReader xmlreader =
                        XMLInputFactory.newInstance().createXMLStreamReader(inStream, charSetEnc);
                SOAPFactory soapFactory = new SOAP11Factory();

                builder = new StAXOMBuilder(xmlreader);
                builder.setOmbuilderFactory(soapFactory);
                envelope = soapFactory.getDefaultEnvelope();
                envelope.getBody().addChild(builder.getDocumentElement());
               
                // We now have the message inside an envolope. However, this is
View Full Code Here

        return returnString;
    }

    public int getChildrenCount(String xml) throws XMLStreamException {
        ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());
        OMElement documentElement = new StAXOMBuilder(bais).getDocumentElement();
        int omElementCount = 0;
        int omTextCount = 0;
        Iterator childrenIter = documentElement.getChildren();
        while (childrenIter.hasNext()) {
            Object o = childrenIter.next();
View Full Code Here

TOP

Related Classes of org.apache.ws.commons.om.impl.builder.StAXOMBuilder

Copyright © 2018 www.massapicom. 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.