Package org.apache.axiom.om.impl.builder

Examples of org.apache.axiom.om.impl.builder.StAXOMBuilder


    }

    public void testMediateWithInLineXML() throws Exception {
        ByteArrayInputStream in = new ByteArrayInputStream(NEW_POLICY.getBytes());
        StAXOMBuilder build = new StAXOMBuilder(in);
        ThrottleTestMediator throttleMediator = new ThrottleTestMediator();
        throttleMediator.setInLinePolicy(build.getDocumentElement());
        MessageContext synCtx = createLightweightSynapseMessageContext("<empty/>");
        synCtx.setProperty(REMOTE_ADDR, "192.168.8.212");
        SynapseConfiguration synCfg = new SynapseConfiguration();
        synCtx.setConfiguration(synCfg);
        for (int i = 0; i < 6; i++) {
View Full Code Here


            XMLInputFactory xmlInFac = XMLInputFactory.newInstance();
            //Non-Coalescing parsing
            xmlInFac.setProperty("javax.xml.stream.isCoalescing", false);

            XMLStreamReader parser = xmlInFac.createXMLStreamReader(strReader);
            StAXOMBuilder builder = new StAXOMBuilder(parser);
            return builder.getDocumentElement();
        }
    }
View Full Code Here

                    getXmlToObjectMapper(connection.getContentType());
            InputStream inputStream = connection.getInputStream();
            try {
                XMLStreamReader parser = XMLInputFactory.newInstance().
                        createXMLStreamReader(inputStream);
                StAXOMBuilder builder = new StAXOMBuilder(parser);
                OMElement omElem = builder.getDocumentElement();

                // detach from URL connection and keep in memory
                // TODO remove this
                omElem.build();
View Full Code Here

            }
            return null;
        }
        InputStream inStream = connection.getInputStream();
        try {
            StAXOMBuilder builder = new StAXOMBuilder(inStream);
            OMElement doc = builder.getDocumentElement();
            doc.build();
            return doc;
        } catch (Exception e) {
            if (log.isDebugEnabled()) {
                log.info("Content at URL : " + url + " is non XML..");
View Full Code Here

        static boolean COMPLETED = false;
        static OMElement RESULT = null;
    }

    private static Policy loadPolicy(String xmlPath) throws Exception {
        StAXOMBuilder builder = new StAXOMBuilder(xmlPath);
        return PolicyEngine.getPolicy(builder.getDocumentElement());
    }
View Full Code Here

                return null;
            }
            if (expectedOutput == ResultBuilderFactory.Output.SOAP_ENVELOPE) {
                return new StAXSOAPModelBuilder(reader).getSOAPEnvelope();
            } else {
                return new StAXOMBuilder(reader).getDocumentElement();
            }
        }
    }
View Full Code Here

    }

    private static OMElement parseFile(File file)
            throws FileNotFoundException, XMLStreamException {
        InputStream is = new FileInputStream(file);
        OMElement document = new StAXOMBuilder(is).getDocumentElement();
        document.build();
        return document;
    }
View Full Code Here

    public static SynapseConfiguration getConfiguration(InputStream is, Properties properties)
            throws XMLStreamException {

        log.info("Generating the Synapse configuration model by parsing the XML configuration");
       
        OMElement definitions = new StAXOMBuilder(is).getDocumentElement();
        definitions.build();

        return ConfigurationFactoryAndSerializerFinder.getInstance()
                .getConfiguration(definitions, properties);
       
View Full Code Here

    private void createPriorityConfiguration(String fileName) throws AxisFault {
        OMElement definitions = null;
        try {
            FileInputStream fis = new FileInputStream(fileName);
            definitions = new StAXOMBuilder(fis).getDocumentElement();
            assert definitions != null;
            definitions.build();
        } catch (FileNotFoundException e) {
            handleException("Priority configuration file cannot be found : " + fileName, e);
        } catch (XMLStreamException e) {
View Full Code Here


    public static OMElement getOMElement(SOAPEnvelope response) {
        XMLStreamReader parser = response.getXMLStreamReader();

        StAXOMBuilder builder =
                new StAXOMBuilder(OMAbstractFactory.getOMFactory(), parser);

        return builder.getDocumentElement();

    }
View Full Code Here

TOP

Related Classes of org.apache.axiom.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.