Package org.apache.tuscany.sca.databinding

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


            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


        return cache.getJAXBContext(cls);
    }

    public static JAXBContext createJAXBContext(TransformationContext tContext, boolean source) throws JAXBException {
        if (tContext == null)
            throw new TransformationException("JAXB context is not set for the transformation.");

        // TODO: [rfeng] Need to figure out what's the best grantularity to create the JAXBContext
        // per interface, operation or parameter
        Operation op = source ? tContext.getSourceOperation() : tContext.getTargetOperation();
        if (op != null) {
View Full Code Here

                    reader.close();
                    return JAXBContextHelper.createReturnValue(jaxbContext, context.getTargetDataType(), result);
                }
            });
        } catch (PrivilegedActionException e) {
            throw new TransformationException(e.getException());
        }
    }
View Full Code Here

        if (dataBindingId != null) {
            DataBinding dataBinding = mediator.getDataBindings().getDataBinding(dataBindingId);
            wrapperHandler = dataBinding == null ? null : dataBinding.getWrapperHandler();
        }
        if (wrapperHandler == null && required) {
            throw new TransformationException("No wrapper handler is provided for databinding: " + dataBindingId);
        }
        return wrapperHandler;
    }
View Full Code Here

                // FIXME: Do we want to handle wrapped to wrapped?
                return mediator.mediate(response, sourceType.getLogical(), targetType.getLogical(), context
                    .getMetadata());
            }
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

        if (dataBindingId != null) {
            DataBinding dataBinding = mediator.getDataBindings().getDataBinding(dataBindingId);
            wrapperHandler = dataBinding == null ? null : dataBinding.getWrapperHandler();
        }
        if (wrapperHandler == null && required) {
            throw new TransformationException("No wrapper handler is provided for databinding: " + dataBindingId);
        }
        return wrapperHandler;
    }
View Full Code Here

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

                    name = ((XMLType)logical).getElementName();
                }
            }
            return new BeanXMLStreamReaderImpl(name, 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

                        return StAXHelper.createXMLStreamReader("<reference xmlns=\"http://callable\">"
                                        + xmlString.substring(xmlString.indexOf("?>") + 2)
                                        + "</reference>");
                    }
                } else {  
                    throw new TransformationException("Unrecognized transformation source object");
                }
            } else {
                return null;
            }
        } 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.