Package org.apache.tuscany.sca.databinding.xml

Examples of org.apache.tuscany.sca.databinding.xml.XMLDocumentStreamReader


    @org.junit.Test
    public void testReader() throws Exception {
        XMLInputFactory factory = XMLInputFactory.newInstance();
        XMLStreamReader r1 = factory.createXMLStreamReader(new StringReader(xml));
        XMLDocumentStreamReader r2 = new XMLDocumentStreamReader(r1);
        XMLStreamReader2String t1 = new XMLStreamReader2String();
        String result = t1.transform(r2, null);
        System.out.println(result);
        XMLStreamReader r3 = factory.createXMLStreamReader(new StringReader(xml));
        r3.nextTag();
        r3.nextTag();
        Assert.assertEquals(XMLStreamConstants.START_ELEMENT, r3.getEventType());
        Assert.assertEquals(new QName(null, "e2"), r3.getName());
        XMLDocumentStreamReader r4 = new XMLDocumentStreamReader(r3);
        result = t1.transform(r4, null);
        System.out.println(result);
    }
View Full Code Here


    @org.junit.Test
    public void testReader() throws Exception {
        XMLInputFactory factory = XMLInputFactory.newInstance();
        XMLStreamReader r1 = factory.createXMLStreamReader(new StringReader(xml));
        XMLDocumentStreamReader r2 = new XMLDocumentStreamReader(r1);
        XMLStreamReader2String t1 = new XMLStreamReader2String();
        String result = t1.transform(r2, null);
        System.out.println(result);
        XMLStreamReader r3 = factory.createXMLStreamReader(new StringReader(xml));
        r3.nextTag();
        r3.nextTag();
        Assert.assertEquals(XMLStreamConstants.START_ELEMENT, r3.getEventType());
        Assert.assertEquals(new QName(null, "e2"), r3.getName());
        XMLDocumentStreamReader r4 = new XMLDocumentStreamReader(r3);
        result = t1.transform(r4, null);
        System.out.println(result);
    }
View Full Code Here

public class JavaBean2XMLStreamReader extends BaseTransformer<Object, XMLStreamReader> implements
    PullTransformer<Object, XMLStreamReader> {

    public XMLStreamReader transform(Object source, TransformationContext context) {
        try {
            return new XMLDocumentStreamReader(BeanUtil.getXMLStreamReader(source));
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

public class JavaBean2XMLStreamReader extends BaseTransformer<Object, XMLStreamReader> implements
    PullTransformer<Object, XMLStreamReader> {

    public XMLStreamReader transform(Object source, TransformationContext context) {
        try {
            return new XMLDocumentStreamReader(BeanUtil.getXMLStreamReader(source));
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

    @org.junit.Test
    public void testReader() throws Exception {
        XMLInputFactory factory = XMLInputFactory.newInstance();
        XMLStreamReader r1 = factory.createXMLStreamReader(new StringReader(xml));
        XMLDocumentStreamReader r2 = new XMLDocumentStreamReader(r1);
        XMLStreamReader2String t1 = new XMLStreamReader2String();
        String result = t1.transform(r2, null);
        System.out.println(result);
        XMLStreamReader r3 = factory.createXMLStreamReader(new StringReader(xml));
        r3.nextTag();
        r3.nextTag();
        Assert.assertEquals(XMLStreamConstants.START_ELEMENT, r3.getEventType());
        Assert.assertEquals(new QName(null, "e2"), r3.getName());
        XMLDocumentStreamReader r4 = new XMLDocumentStreamReader(r3);
        result = t1.transform(r4, null);
        System.out.println(result);
    }
View Full Code Here

    @org.junit.Test
    public void testReader() throws Exception {
        XMLInputFactory factory = XMLInputFactory.newInstance();
        XMLStreamReader r1 = factory.createXMLStreamReader(new StringReader(xml));
        XMLDocumentStreamReader r2 = new XMLDocumentStreamReader(r1);
        XMLStreamReader2String t1 = new XMLStreamReader2String();
        String result = t1.transform(r2, null);
        System.out.println(result);
        XMLStreamReader r3 = factory.createXMLStreamReader(new StringReader(xml));
        r3.nextTag();
        r3.nextTag();
        Assert.assertEquals(XMLStreamConstants.START_ELEMENT, r3.getEventType());
        Assert.assertEquals(new QName(null, "e2"), r3.getName());
        XMLDocumentStreamReader r4 = new XMLDocumentStreamReader(r3);
        result = t1.transform(r4, null);
        System.out.println(result);
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.databinding.xml.XMLDocumentStreamReader

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.