Package org.apache.tuscany.spi.databinding

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


            reader.setFeature("http://xml.org/sax/features/namespaces", true);
            reader.setFeature("http://xml.org/sax/features/namespace-prefixes", false);
            reader.setContentHandler(target);
            reader.parse(source);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here


            XMLDocument document =
                    xmlHelper.createDocument(source, elementName.getNamespaceURI(), elementName.getLocalPart());
            return streamHelper.createXMLStreamReader(document);
        } catch (XMLStreamException e) {
            // TODO: Add context to the exception
            throw new TransformationException(e);
        }
    }
View Full Code Here

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

        try {
            DocumentBuilder builder = DOMHelper.newDocumentBuilder();
            InputSource inputSource = new InputSource(new StringReader(source));
            return builder.parse(inputSource);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

    public void transform(XMLStreamReader source, ContentHandler sink, TransformationContext context) {
        StAX2SAXAdapter adapter = new StAX2SAXAdapter(false);
        try {
            adapter.parse(source, sink);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

    public void transform(Source source, Result result, TransformationContext context) {
        try {
            javax.xml.transform.Transformer transformer = FACTORY.newTransformer();
            transformer.transform(source, result);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

    public DOMWrapperHandler() {
        super();
        try {
            this.document = DOMHelper.newDocument();
        } catch (ParserConfigurationException e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

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

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

        try {
            TypeHelper typeHelper = SDODataTypeHelper.getTypeHelper(context);
            XMLHelper xmlHelper = SDOUtil.createXMLHelper(typeHelper);
            return xmlHelper.load(source).getRootObject();
        } 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.