Package org.apache.tuscany.sca.interfacedef.util

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


                        type = asyncMethod.getGenericReturnType();
                    }
                    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


        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

                    }
                    outputElements.add(new ElementInfo(element, new TypeInfo(type, false, 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

* @version $Rev: 909092 $ $Date: 2010-02-11 17:44:00 +0000 (Thu, 11 Feb 2010) $
*/
public class SDOWrapperHandler implements WrapperHandler<Object> {

    public Object create(Operation operation, boolean input) {
        WrapperInfo wrapperInfo = operation.getWrapper();
       

        ElementInfo element = input ? wrapperInfo.getInputWrapperElement() :
            wrapperInfo.getOutputWrapperElement();
       
        HelperContext helperContext = SDOContextHelper.getHelperContext(operation);
        Type sdoType = getSDOType(helperContext, element);
        if (sdoType != null) {
            DataFactory dataFactory = helperContext.getDataFactory();
View Full Code Here

        }
        return null;
    }

    public void setChildren(Object wrapper, Object[] childObjects, Operation operation, boolean input) {
        WrapperInfo wrapperInfo = operation.getWrapper();
      
       
        List<ElementInfo> childElements = input? wrapperInfo.getInputChildElements():
            wrapperInfo.getOutputChildElements();

        for (int i = 0; i < childElements.size(); i++) {
            setChild(wrapper, i, childElements.get(i), childObjects[i]);
        }
    }
View Full Code Here

    /**
     * @see org.apache.tuscany.sca.databinding.WrapperHandler#getWrapperType(Operation, boolean)
     */
    public DataType getWrapperType(Operation operation, boolean input) {
        WrapperInfo wrapperInfo = operation.getWrapper();
      

        ElementInfo element = input ? wrapperInfo.getInputWrapperElement() :
            wrapperInfo.getOutputWrapperElement();
       
        HelperContext helperContext = SDOContextHelper.getHelperContext(operation);
        Type sdoType = getSDOType(helperContext, element);
        if (sdoType != null) {
            // Check if child elements matches
View Full Code Here

    /**
     * @see org.apache.tuscany.sca.databinding.WrapperHandler#isInstance(java.lang.Object, Operation, boolean)
     */
    public boolean isInstance(Object wrapper, Operation operation, boolean input) {
        WrapperInfo wrapperInfo = operation.getWrapper();
       

        ElementInfo element = input ? wrapperInfo.getInputWrapperElement() :
            wrapperInfo.getOutputWrapperElement();
       
        //        List<ElementInfo> childElements =
        //            input ? wrapperInfo.getInputChildElements() : wrapperInfo.getOutputChildElements();
        HelperContext helperContext = SDOContextHelper.getHelperContext(operation);
        Type sdoType = getSDOType(helperContext, element);
View Full Code Here

    }
   
    private Map<XMLTypeHelper, List<DataType>> getDataTypes(Interface intf, boolean useWrapper, Map<String, XMLTypeHelper> helpers) {
        Map<XMLTypeHelper, List<DataType>> dataTypes = new HashMap<XMLTypeHelper, List<DataType>>();
        for (Operation op : intf.getOperations()) {
            WrapperInfo wrapper = op.getWrapper();
            if (useWrapper && wrapper != null) {
                DataType dt1 = wrapper.getInputWrapperType();
                addDataType(dataTypes, dt1, helpers);
                DataType dt2 = wrapper.getOutputWrapperType();
                addDataType(dataTypes, dt2, helpers);
            } else {
                for (DataType dt1 : op.getInputType().getLogical()) {
                    addDataType(dataTypes, dt1, helpers);
                }
View Full Code Here

                                    Map<QName, List<ElementInfo>> wrappers,
                                    boolean input) throws WSDLException {
        Part part = definition.createPart();
        String partName = input ? operation.getName() : (operation.getName() + "Response");
        part.setName(partName);
        WrapperInfo opWrapper = operation.getWrapper();
        if (opWrapper != null) {
            ElementInfo elementInfo =
                input ? opWrapper.getInputWrapperElement() : opWrapper.getOutputWrapperElement();
            List<ElementInfo> elements =
                input ? opWrapper.getInputChildElements() : opWrapper.getOutputChildElements();
            QName wrapperName = elementInfo.getQName();
            part.setElementName(wrapperName);
            addNamespace(definition, wrapperName);
            wrappers.put(wrapperName, elements);
View Full Code Here

                    }
                    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

TOP

Related Classes of org.apache.tuscany.sca.interfacedef.util.WrapperInfo

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.