Examples of TransformationContextImpl


Examples of org.apache.tuscany.sca.databinding.impl.TransformationContextImpl

    @Test
    public void testTransform() throws Exception {
        DataType<?> sourceDataType = new DataTypeImpl<XMLType>(PurchaseOrderType.class, XMLType.UNKNOWN);
        QName qname = new QName("http://www.example.com/IPO", "purchaseOrder");
        DataType<?> targetDataType = new DataTypeImpl<XMLType>(PurchaseOrderType.class, new XMLType(qname, null));
        TransformationContext tContext = new TransformationContextImpl();
        tContext.setSourceDataType(sourceDataType);
        tContext.setTargetDataType(targetDataType);

        StAXOMBuilder builder = new StAXOMBuilder(new ByteArrayInputStream(XML.getBytes("UTF-8")));
        OMElement root = builder.getDocumentElement();
        OMElement next = (OMElement)root.getChildElements().next();
        OMElement po = (OMElement)next.getChildElements().next();
View Full Code Here

Examples of org.apache.tuscany.sca.databinding.impl.TransformationContextImpl

    @Test
    public void testTransformElement() throws Exception {
        JAXBElement<PurchaseOrderType> po = createPO();
        DataType<?> sourceDataType = new DataTypeImpl<XMLType>(PurchaseOrderType.class, XMLType.UNKNOWN);
        DataType<?> targetDataType = new DataTypeImpl<XMLType>(PurchaseOrderType.class, new XMLType(po.getName(), null));
        TransformationContext tContext = new TransformationContextImpl();
        tContext.setSourceDataType(sourceDataType);
        tContext.setTargetDataType(targetDataType);

        // Force the JAXBContext to be cached
        JAXBContextHelper.createJAXBContext(tContext, true);

        long start = System.currentTimeMillis();
View Full Code Here
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.