Package org.apache.tuscany.spi.databinding

Examples of org.apache.tuscany.spi.databinding.TransformationException


            Source streamSource = new StreamSource(source);
            DOMResult result = new DOMResult();
            TRANSFORMER.transform(streamSource, result, context);
            return result.getNode();
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here


    private List<Transformer> getTransformerChain(DataType sourceDataType, DataType targetDataType) {
        String sourceId = sourceDataType.getDataBinding();
        String targetId = targetDataType.getDataBinding();
        List<Transformer> path = transformerRegistry.getTransformerChain(sourceId, targetId);
        if (path == null) {
            TransformationException ex = new TransformationException("No path found for the transformation");
            ex.addContextName("Source: " + sourceId);
            ex.addContextName("Target: " + targetId);
            throw ex;
        }
        return path;
    }
View Full Code Here

        try {
            Source domSource = new DOMSource(source);
            Result result = new StreamResult(writer);
            TRANSFORMER.transform(domSource, result, context);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

                return xmlHelper.save(source, elementName.getNamespaceURI(), elementName.getLocalPart());
            } else {
                return xmlHelper.save(source, TUSCANY_SDO, "dataObject");
            }
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

        try {
            StringWriter writer = new StringWriter();
            TRANSFORMER.transform(source, writer, context);
            return writer.toString();
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

            while (source.getEventType() != XMLStreamConstants.START_ELEMENT && source.hasNext()) {
                source.next();
            }
            return streamHelper.loadObject(source);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

        try {
            TypeHelper typeHelper = SDODataTypeHelper.getTypeHelper(context);
            XMLStreamHelper streamHelper = SDOUtil.createXMLStreamHelper(typeHelper);
            return streamHelper.load(source);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

            XMLHelper xmlHelper = SDOUtil.createXMLHelper(typeHelper);
            StringWriter writer = new StringWriter();
            xmlHelper.save(source, writer, null);
            return writer.toString();
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

    public XMLStreamReader transform(Node source, TransformationContext context) {
        try {
            DOMXMLStreamReader reader = new DOMXMLStreamReader(source);
            return new XMLDocumentStreamReader(reader);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.spi.databinding.TransformationException

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.