Examples of transform()


Examples of org.apache.tuscany.databinding.jaxb.Reader2JAXB.transform()

        PurchaseOrderDocument po2 = (PurchaseOrderDocument)t2.transform(reader, null);
        client.call(po2.getPurchaseOrder());

        Reader2JAXB t3 = new Reader2JAXB();
        JAXBElement<PurchaseOrderType> po3 =
            (JAXBElement<PurchaseOrderType>)t3.transform(new StringReader(IPO_XML), tContext);
        client.call(po3.getValue());

    }

    protected void setUp() throws Exception {

Examples of org.apache.tuscany.databinding.jaxb.XMLStreamReader2JAXB.transform()

        expect(tContext.getTargetDataType()).andReturn(targetDataType).anyTimes();
        replay(tContext);

        // XMLStreamReader to JAXB
        XMLStreamReader2JAXB t2 = new XMLStreamReader2JAXB();
        Object object2 = t2.transform(reader, tContext);

        DataType sourceDataType = new DataType<Class>(Object.class, null);
        sourceDataType.setMetadata(JAXBContextHelper.JAXB_CONTEXT_PATH, contextPath);

        TransformationContext tContext1 = createMock(TransformationContext.class);

Examples of org.apache.tuscany.databinding.sdo.String2DataObject.transform()

        TransformationContext tContext = createMock(TransformationContext.class);
        expect(tContext.getTargetDataType()).andReturn(targetDataType).anyTimes();
        replay(tContext);

        String2DataObject t1 = new String2DataObject();
        DataObject po1 = t1.transform(IPO_XML, null);
        client.call(po1);

        XMLStreamReader reader =
            XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(IPO_XML));
        XMLStreamReader2XmlObject t2 = new XMLStreamReader2XmlObject();

Examples of org.apache.tuscany.databinding.sdo.XMLDocument2XMLStreamReader.transform()

        boolean isWrapped = false;

        XMLDocument document = toXMLDocument(callback.getTypeHelper(), new Object[]{obj}, elName, isWrapped);
        // HACK: [rfeng] We should use the transformer in an interceptor
        XMLDocument2XMLStreamReader transformer = new XMLDocument2XMLStreamReader();
        XMLStreamReader reader = transformer.transform(document, null);

        try {
            //CeltixFire supports Stax, we should not need to do following anymore.
            readDocElements(output, reader, true, null);
        } catch (XMLStreamException e) {

Examples of org.apache.tuscany.databinding.sdo.XMLStreamReader2XMLDocument.transform()

            XMLStreamReader2XMLDocument transformer = new XMLStreamReader2XMLDocument();
            TransformationContext context = new TransformationContextImpl();
            DataType<QName> binding = new DataType<QName>(DataObject.class, null);
            binding.setMetadata(TypeHelper.class.getName(), callback.getTypeHelper());
            context.setTargetDataType(binding);
            XMLDocument document = transformer.transform(reader, context);

            boolean isWrapped = false;
            return toObjects(document, isWrapped);
        } catch (Exception e) {
            //REVISIT: better handling of exceptions

Examples of org.apache.tuscany.databinding.xmlbeans.Node2XmlObject.transform()

        JAXB2Node t3 = new JAXB2Node();
        Node node = t3.transform(object2, tContext1);

        Node2XmlObject t4 = new Node2XmlObject();
        XmlObject object3 = t4.transform(node, null);

        Assert.assertNotNull(object3);

    }

Examples of org.apache.tuscany.databinding.xmlbeans.XMLStreamReader2XmlObject.transform()

        XmlObject2XMLStreamReader t1 = new XmlObject2XMLStreamReader();
        XMLStreamReader reader = t1.transform(object, null);

        // XMLStreamReader to XmlObject
        XMLStreamReader2XmlObject t2 = new XMLStreamReader2XmlObject();
        XmlObject object2 = t2.transform(reader, null);

        // XmlObject to Node
        XmlObject2Node t3 = new XmlObject2Node();
        Node node = t3.transform(object2, null);

Examples of org.apache.tuscany.databinding.xmlbeans.XmlObject2Node.transform()

        XMLStreamReader2XmlObject t2 = new XMLStreamReader2XmlObject();
        XmlObject object2 = t2.transform(reader, null);

        // XmlObject to Node
        XmlObject2Node t3 = new XmlObject2Node();
        Node node = t3.transform(object2, null);

        // Node to XmlObject
        Node2XmlObject t4 = new Node2XmlObject();
        XmlObject object3 = t4.transform(node, null);
        Assert.assertNotNull(object3);

Examples of org.apache.tuscany.databinding.xmlbeans.XmlObject2XMLStreamReader.transform()

        // URL/Stream/Reader to XmlObject
        XmlObject object = XmlObject.Factory.parse(new StringReader(IPO_XML));

        // XmlObject to XMLStreamReader
        XmlObject2XMLStreamReader t1 = new XmlObject2XMLStreamReader();
        XMLStreamReader reader = t1.transform(object, null);

        DataType targetDataType = new DataType<Class>(Object.class, null);
        targetDataType.setMetadata(JAXBContextHelper.JAXB_CONTEXT_PATH, contextPath);

        TransformationContext tContext = createMock(TransformationContext.class);

Examples of org.apache.tuscany.sca.databinding.javabeans.JavaBean2XMLStreamReader.transform()

        bean.str = "ABC";
        bean.i = 1;
        bean.arr = new long[] {1, 2, 3};
        bean.bean = new AnotherBean();
        bean.bean.setName("Name");
        XMLStreamReader reader = t2.transform(bean, null);
        XMLStreamReader2String t3 = new XMLStreamReader2String();
        String xml = t3.transform(reader, null);
        assertTrue(xml.contains("<JavaBean2XMLStreamReaderTestCase$MyBean>"
                     + "<arr>1</arr><arr>2</arr><arr>3</arr><bean><name>Name</name></bean>"
                     + "<i>1</i><str>ABC</str></JavaBean2XMLStreamReaderTestCase$MyBean>"));
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.