Package org.apache.tuscany.sca.interfacedef

Examples of org.apache.tuscany.sca.interfacedef.DataType


                    } else {
                        inArg.setDataBinding(SaxonNodeDataBinding.NAME);
                    }
                }
            }
            DataType outputType = operation.getOutputType();
            if (outputType != null) {
                if (SimpleJavaDataBinding.NAME.equals(outputType.getDataBinding())) {
                    if (!isReference) {
                        outputType.setDataBinding(SaxonValueDataBinding.NAME);
                    }
                } else {
                    outputType.setDataBinding(SaxonNodeDataBinding.NAME);
                }
            }
        }
    }
View Full Code Here


     * @param context
     * @param element
     */
    public static Element adjustElementName(TransformationContext context, Element element) {
        if (context != null) {
            DataType dataType = context.getTargetDataType();
            Object logical = dataType == null ? null : dataType.getLogical();
            if (!(logical instanceof XMLType)) {
                return element;
            }
            XMLType xmlType = (XMLType)logical;
            QName name = new QName(element.getNamespaceURI(), element.getLocalName());
View Full Code Here

    }

    public T transform(Object source, TransformationContext context) {
        QName rootElement = null;
        if (context != null) {
            DataType type = context.getTargetDataType();
            if (type != null) {
                Object logical = type.getLogical();
                if (logical instanceof XMLType) {
                    rootElement = ((XMLType)logical).getElementName();
                }
            }
        }
View Full Code Here

            || DataBinding.IDL_FAULT.equals(db)
            || SDODataBinding.NAME.equals(db)) {
            Class javaType = dataType.getPhysical();
            found = register(helperContext, javaType);
            if (dataType.getLogical() instanceof DataType) {
                DataType logical = (DataType)dataType.getLogical();
                found = register(helperContext, logical.getPhysical()) || found;
            }
            if (dataType.getLogical() instanceof List) {
                List types = (List)dataType.getLogical();
                for (Object type : types) {
                    if (type instanceof DataType) {
View Full Code Here

    }

    private static void adjustElementName(TransformationContext context, OMElement element) {
        if (context != null) {
            DataType dataType = context.getTargetDataType();
            Object logical = dataType == null ? null : dataType.getLogical();
            if (!(logical instanceof XMLType)) {
                return;
            }
            XMLType xmlType = (XMLType)logical;
            if (xmlType.isElement() && !xmlType.getElementName().equals(element.getQName())) {
View Full Code Here

        Class physical = dataType.getPhysical();
        if (!physical.isArray() || physical == byte[].class) {
            return false;
        }
        Class componentType = physical.getComponentType();
        DataType logical = new DataTypeImpl(componentType, dataType.getLogical());
        introspectType(logical, annotations);
        dataType.setDataBinding("java:array");
        dataType.setLogical(logical);
        return true;
    }
View Full Code Here

        }
    }

    public DataType introspectType(Object value) {
        loadDataBindings();
        DataType dataType = null;
        for (DataBinding binding : bindings.values()) {
            // don't introspect for JavaBeansDatabinding as all javatypes will
            // anyways match to its basetype
            // which is java.lang.Object. Default to this only if no databinding
            // results
View Full Code Here

        }
        Throwable ex = (Throwable)fault;
        DataType<DataType> exType =
            new DataTypeImpl<DataType>(ex.getClass(), new DataTypeImpl<XMLType>(ex.getClass(), XMLType.UNKNOWN));
        faultExceptionMapper.introspectFaultDataType(exType);
        DataType faultType = exType.getLogical();
        Object faultInfo = faultExceptionMapper.getFaultInfo(ex, faultType.getPhysical());
        faultInfo = copy(faultInfo, dataBindings.getDataBinding(faultType.getDataBinding()));
        fault = faultExceptionMapper.wrapFaultInfo(exType, ex.getMessage(), faultInfo, ex.getCause());
        return fault;
    }
View Full Code Here

        if (source.isWrapperStyle() != target.isWrapperStyle()) {
            return true;
        }

        // Check output type
        DataType sourceOutputType = source.getOutputType();
        DataType targetOutputType = target.getOutputType();

        // Note the target output type is now the source for checking
        // compatibility
        if (isTransformationRequired(targetOutputType, sourceOutputType)) {
            return true;
View Full Code Here

        mediator = new MediatorImpl(dataBindingRegistry, registry);
    }

    private TransformationContext createTransformationContext(Class sourceType, Class targetType) {
        TransformationContext context = new TransformationContextImpl();
        DataType sourceDataType = new DataTypeImpl<Class>(sourceType.getName(), sourceType, sourceType);
        DataType targetDataType = new DataTypeImpl<Class>(targetType.getName(), targetType, targetType);
        context.setSourceDataType(sourceDataType);
        context.setTargetDataType(targetDataType);
        return context;
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.interfacedef.DataType

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.