Package org.apache.tuscany.sca.databinding

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


            Properties props = new Properties();
            props.setProperty(OutputKeys.METHOD, "xml");
            props.setProperty(OutputKeys.INDENT, "yes");
            QueryResult.serialize(source, destination, props, source.getConfiguration());
        } catch (Exception e) {
            throw new TransformationException(e);
        }
        return destination.getNode();
    }
View Full Code Here


        NodeInfo docInfo = null;
        try {
            source = DOMHelper.promote(source);
            docInfo = Builder.build(new DOMSource(source), null, configuration);
        } catch (XPathException e) {
            throw new TransformationException(e);
        }
        return docInfo;
    }
View Full Code Here

    public Object transform(Value source, TransformationContext context) {
        Object object;
        try {
          object = Value.convert(Value.asItem(source));
        } catch (XPathException e) {
            throw new TransformationException(e);
        }
        return object;
    }
View Full Code Here

            // FIXME: [rfeng] We should use the HelperContext from the context
            DataObject resultingObject =
                XMLHelper.INSTANCE.load(new DOMSource(doc), doc.getDocumentURI(), null).getRootObject();
            return resultingObject;
        } catch (IOException e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

    public Object transform(Value source, TransformationContext context) {
        Object object;
        try {
          object = Value.convert(Value.asItem(source));
        } catch (XPathException e) {
            throw new TransformationException(e);
        }
        return object;
    }
View Full Code Here

            DOMResult domResult = new DOMResult(DOMHelper.newDocument());
            XMLDocument xmlDoc = helper.createDocument(source, null, name);
            helper.save(xmlDoc, domResult, null);
            return node2NodeInfoTransformer.transform(domResult.getNode(), context);
        } catch (Exception e) {
            throw new TransformationException(e);
        }

    }
View Full Code Here

            StAXOMBuilder builder = new StAXOMBuilder(source);
            OMElement element = builder.getDocumentElement();
            AxiomHelper.adjustElementName(context, element);
            return element;
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

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

    public JavaBean2JSON() {
        serializer = new JSONSerializer();
        try {
            serializer.registerDefaultSerializers();
        } catch (Exception e) {
            throw new TransformationException(e);
        }
        serializer.setMarshallClassHints(true);
        serializer.setMarshallNullAttributes(true);
    }
View Full Code Here

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

TOP

Related Classes of org.apache.tuscany.sca.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.