Examples of WrapperInfo


Examples of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

        elements.get(3).setMany(true);
        // INPUT2 is like minOccurs="0", nillable="false"
        elements.get(1).setOmissible(true);
        elements.get(1).setNillable(false);

        WrapperInfo wrapperInfo = new WrapperInfo(DOMDataBinding.NAME, null, null, elements, null);
        this.op = new OperationImpl();
        op.setWrapper(wrapperInfo);  
    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

    public void visitInterface(JavaInterface javaInterface) throws InvalidInterfaceException {
        if (!javaInterface.isRemotable()) {
            return;
        }
        for (Operation operation : javaInterface.getOperations()) {
            WrapperInfo wrapper = operation.getWrapper();
            if (wrapper == null) {
                continue;
            }
            // JIRA: TUSCANY-842
            String db = wrapper.getDataBinding();
            if (db == null || JAXB_DATABINDING.equals(db)) {
                db = assignOperationDataBinding(operation);
            }

            // Introspect the wrapper data type
            org.apache.tuscany.sca.databinding.DataBinding dbObj = dataBindingRegistry.getDataBinding(db);
            WrapperHandler handler = dbObj == null ? null : dbObj.getWrapperHandler();
            if (handler != null) {
                wrapper.setInputWrapperType(handler.getWrapperType(operation, true));
                wrapper.setOutputWrapperType(handler.getWrapperType(operation, false));
            }
            if (dbObj != null && handler == null) {
                // To avoid JAXB wrapper bean generation
                wrapper.setInputWrapperType(null);
                wrapper.setOutputWrapperType(null);
            }
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

        super();
        this.factory = OMAbstractFactory.getOMFactory();
    }

    public OMElement create(Operation operation, boolean input) {
        WrapperInfo wrapperInfo = operation.getWrapper();
        ElementInfo element = input ? wrapperInfo.getInputWrapperElement() : wrapperInfo.getOutputWrapperElement();
        // Class<?> wrapperClass = input ? wrapperInfo.getInputWrapperClass() : wrapperInfo.getOutputWrapperClass();
        OMElement wrapper = AxiomHelper.createOMElement(factory, element.getQName());
        return wrapper;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

    /**
     * @see org.apache.tuscany.sca.databinding.WrapperHandler#getWrapperType(Operation, boolean)
     */
    public DataType getWrapperType(Operation operation, boolean input) {
        WrapperInfo wrapper = operation.getWrapper();
        ElementInfo element = input ? wrapper.getInputWrapperElement() : wrapper.getOutputWrapperElement();
        DataType<XMLType> wrapperType =
            new DataTypeImpl<XMLType>(AxiomDataBinding.NAME, OMElement.class, new XMLType(element));
        return wrapperType;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

            new DataTypeImpl<XMLType>(AxiomDataBinding.NAME, OMElement.class, new XMLType(element));
        return wrapperType;
    }

    public boolean isInstance(Object wrapperObj, Operation operation, boolean input) {
        WrapperInfo wrapperInfo = operation.getWrapper();
        ElementInfo element = input ? wrapperInfo.getInputWrapperElement() : wrapperInfo.getOutputWrapperElement();
        //        List<ElementInfo> childElements =
        //            input ? wrapperInfo.getInputChildElements() : wrapperInfo.getOutputChildElements();
        OMElement wrapper = (OMElement)wrapperObj;
        if (!element.getQName().equals(wrapper.getQName())) {
            return false;
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

                        type = asyncMethod.getGenericReturnType();
                    } // end if
                    if (type instanceof ParameterizedType) {
                        // Check if the parameterized type of Response<T> is a doc-lit-wrapper class
                        Class<?> wrapperClass = (Class<?>)((ParameterizedType)type).getActualTypeArguments()[0];
                        WrapperInfo wrapperInfo = chain.getSourceOperation().getWrapper();
                        if (wrapperInfo != null && wrapperInfo.getOutputWrapperClass() == wrapperClass) {
                            Object wrapper = wrapperClass.newInstance();
                            // Find the 1st matching property
                            for (PropertyDescriptor p : Introspector.getBeanInfo(wrapperClass).getPropertyDescriptors()) {
                                if (p.getWriteMethod() == null) {
                                    // There is a "class" property ...
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

        getDataTypes(dataTypes, op, useWrapper);
        return dataTypes;
    }

    private static void getDataTypes(List<DataType> dataTypes, Operation op, boolean useWrapper) {
        WrapperInfo wrapper = op.getWrapper();
        if (useWrapper && wrapper != null) {
            DataType dt1 = wrapper.getInputWrapperType();
            if (dt1 != null) {
                dataTypes.add(dt1);
            }
            DataType dt2 = wrapper.getOutputWrapperType();
            if (dt2 != null) {
                dataTypes.add(dt2);
            }
        }
        // FIXME: [rfeng] We may need to find the referenced classes in the child types
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

                    }
                    outputElements.add(new ElementInfo(element, null));
                }

                String db = inputWrapperDT != null ? inputWrapperDT.getDataBinding() : JAXB_DATABINDING;
                WrapperInfo wrapperInfo =
                    new WrapperInfo(db, new ElementInfo(inputWrapper, null), new ElementInfo(outputWrapper, null),
                                    inputElements, outputElements);

                wrapperInfo.setInputWrapperType(inputWrapperDT);
                wrapperInfo.setOutputWrapperType(outputWrapperDT);

                operation.setWrapper(wrapperInfo);
            }
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

            if (operation.getWrapper() != null) {
                org.apache.tuscany.sca.databinding.DataBinding dbObj =
                    dataBindingRegistry.getDataBinding(db);
                WrapperHandler handler = dbObj == null ? null : dbObj.getWrapperHandler();
                if (handler != null) {
                    WrapperInfo wrapper = operation.getWrapper();
                    wrapper.setInputWrapperType(handler.getWrapperType(operation, true));
                    wrapper.setOutputWrapperType(handler.getWrapperType(operation, false));
                }
                if (dbObj != null && handler == null) {
                    // To avoid JAXB wrapper bean generation
                    WrapperInfo wrapper = operation.getWrapper();
                    wrapper.setInputWrapperType(null);
                    wrapper.setOutputWrapperType(null);
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

                        }

                    }
                }
                if (op.isWrapperStyle()) {
                    WrapperInfo wrapper = op.getWrapper();
                    if (wrapper != null) {
                        DataType<List<DataType>> unwrappedInputType = wrapper.getUnwrappedInputType();
                        if (unwrappedInputType != null) {
                            for (DataType d : unwrappedInputType.getLogical()) {
                                if (d.getDataBinding() == null) {
                                    d.setDataBinding(dataBinding);
                                }
                            }
                        }
                        DataType unwrappedOutputType = wrapper.getUnwrappedOutputType();
                        if (unwrappedOutputType != null && unwrappedOutputType.getDataBinding() == null) {
                            unwrappedOutputType.setDataBinding(dataBinding);
                        }
                    }
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.