Package org.switchyard.common.io.pull

Examples of org.switchyard.common.io.pull.ElementPuller


                if (qualifiedForSoapHeader && matches(qname)) {
                    if (value instanceof Node) {
                        Node domNode = soapHeader.getOwnerDocument().importNode((Node)value, true);
                        soapHeader.appendChild(domNode);
                    } else if (value instanceof Configuration) {
                        Element configElement = new ElementPuller().pull(new StringReader(value.toString()));
                        Node configNode = soapHeader.getOwnerDocument().importNode(configElement, true);
                        soapHeader.appendChild(configNode);
                    } else {
                        String v = value.toString();
                        if (SOAPHeadersType.XML.equals(_soapHeadersType)) {
                            try {
                                Element xmlElement = new ElementPuller().pull(new StringReader(v));
                                Node xmlNode = soapHeader.getOwnerDocument().importNode(xmlElement, true);
                                soapHeader.appendChild(xmlNode);
                            } catch (Throwable t) {
                                soapHeader.addChildElement(qname).setValue(v);
                            }
View Full Code Here


    /**
     * Constructs a new ConfigurationPuller (ignoring comments when parsing XML).
     */
    public ConfigurationPuller() {
        _elementPuller = new ElementPuller();
    }
View Full Code Here

    /**
     * Constructs a new ConfigurationPuller (optionally ignoring comments when parsing XML).
     * @param ignoringComments whether comments should be ignored when parsing XML.
     */
    public ConfigurationPuller(boolean ignoringComments) {
        _elementPuller = new ElementPuller(ignoringComments);
    }
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public Object decompose(Graph graph) {
        try {
            return new ElementPuller(false).pull(new StringReader(_xml));
        } catch (IOException ioe) {
            throw new RuntimeException(ioe);
        }
    }
View Full Code Here

        parentGroup.addMember(user);
        GroupPrincipal childGroup = new GroupPrincipal("testChildGroup");
        childGroup.addMember(role);
        parentGroup.addMember(childGroup);
        Set<Credential> creds = new LinkedHashSet<Credential>();
        creds.add(new AssertionCredential(new ElementPuller().pull(new StringReader("<testAssertion/>"))));
        creds.add(SOAPMessageCredentialExtractorTests.getBinarySecurityTokenCertificateCredential());
        creds.add(new ConfidentialityCredential(true));
        creds.add(new ConfidentialityCredential(false));
        creds.add(new NameCredential("testName"));
        creds.add(new PasswordCredential("testPassword"));
View Full Code Here

    }

    @Test
    public void testDOMProperty() throws Exception {
        final String expectedXML = "<one number=\"1\"><two number=\"2\"/></one>";
        final Element expectedDOM = new ElementPuller().pull(new StringReader(expectedXML));
        RemoteMessage msg = new RemoteMessage();
        msg.getContext().setProperty("one", expectedDOM);
        msg = serDeser(msg, RemoteMessage.class);
        final Element actualDOM = (Element)msg.getContext().getProperty("one").getValue();
        final String actualXML = XMLHelper.toString(actualDOM);
View Full Code Here

    }

    @Test
    public void testDOMContent() throws Exception {
        final String expectedXML = "<one number=\"1\"><two number=\"2\"/></one>";
        final Element expectedDOM = new ElementPuller().pull(new StringReader(expectedXML));
        RemoteMessage msg = new RemoteMessage();
        msg.setContent(expectedDOM);
        msg = serDeser(msg, RemoteMessage.class);
        final Element actualDOM = (Element)msg.getContent();
        final String actualXML = XMLHelper.toString(actualDOM);
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public M pull(InputStream stream) throws IOException {
        return pull(new ElementPuller().pull(stream));
    }
View Full Code Here

     * @param reader a Reader of the Model
     * @return the Model, or null if not found
     * @throws IOException if a problem occurred
     */
    public M pull(Reader reader) throws IOException {
        return pull(new ElementPuller().pull(reader));
    }
View Full Code Here

     * @param source an InputSource of the Model
     * @return the Model, or null if not found
     * @throws IOException if a problem occurred
     */
    public M pull(InputSource source) throws IOException {
        return pull(new ElementPuller().pull(source));
    }
View Full Code Here

TOP

Related Classes of org.switchyard.common.io.pull.ElementPuller

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.