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

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


                    QName type = null;
                    if (logical instanceof XMLType) {
                        ((XMLType)logical).setElementName(element);
                        type = ((XMLType)logical).getTypeName();
                    }
                    inputElements.add(new ElementInfo(element, new TypeInfo(type, false, null)));
                    if (param != null) {
                        parameterModes.set(i, getParameterMode(parameterTypes[i], param.mode()));
                    } else {
                        parameterModes.set(i, getParameterMode(parameterTypes[i], null));
                    }
                }

                List<ElementInfo> outputElements = new ArrayList<ElementInfo>();
                WebResult result = method.getAnnotation(WebResult.class);
                // Default to "" for doc-lit-wrapped && non-header
                ns = result != null ? result.targetNamespace() : "";
                ns = getValue(ns, documentStyle && (result == null || !result.header()) ? "" : tns);
                name = result != null ? result.name() : "";
                name = getValue(name, "return");
                QName element = new QName(ns, name);

                if (operation.getOutputType() != null) {
                    Object logical = operation.getOutputType().getLogical();
                    QName type = null;
                    if (logical instanceof XMLType) {
                        ((XMLType)logical).setElementName(element);
                        type = ((XMLType)logical).getTypeName();
                    }
                    outputElements.add(new ElementInfo(element, new TypeInfo(type, false, null)));
                }

                String db = inputWrapperDT != null ? inputWrapperDT.getDataBinding() : JAXB_DATABINDING;

                WrapperInfo inputWrapperInfo = new WrapperInfo(db, new ElementInfo(inputWrapper, null), inputElements);
                WrapperInfo outputWrapperInfo =
                    new WrapperInfo(db, new ElementInfo(outputWrapper, null), outputElements);

                inputWrapperInfo.setWrapperType(inputWrapperDT);
                outputWrapperInfo.setWrapperType(outputWrapperDT);

                operation.setInputWrapper(inputWrapperInfo);
View Full Code Here


     */
    public XmlObject create(Operation operation, boolean input) {
        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();

        ElementInfo element = input ? inputWrapperInfo.getWrapperElement() :
            outputWrapperInfo.getWrapperElement();
       
        return null;
    }
View Full Code Here

     */
    public boolean isInstance(Object wrapper, Operation operation, boolean input) {
        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();

        ElementInfo element = input ? inputWrapperInfo.getWrapperElement() :
            outputWrapperInfo.getWrapperElement();
       
        return true;
    }
View Full Code Here

    public Object create(Operation operation, boolean input) {
        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();

        ElementInfo element = input ? inputWrapperInfo.getWrapperElement() :
            outputWrapperInfo.getWrapperElement();
       
        HelperContext helperContext = SDOContextHelper.getHelperContext(operation);
        Type sdoType = getSDOType(helperContext, element);
        if (sdoType != null) {
View Full Code Here

     */
    public DataType getWrapperType(Operation operation, boolean input) {
        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();

        ElementInfo element = input ? inputWrapperInfo.getWrapperElement() :
            outputWrapperInfo.getWrapperElement();
       
        HelperContext helperContext = SDOContextHelper.getHelperContext(operation);
        Type sdoType = getSDOType(helperContext, element);
        if (sdoType != null) {
View Full Code Here

     */
    public boolean isInstance(Object wrapper, Operation operation, boolean input) {
        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();

        ElementInfo element = input ? inputWrapperInfo.getWrapperElement() :
            outputWrapperInfo.getWrapperElement();
       
        //        List<ElementInfo> childElements =
        //            input ? wrapperInfo.getInputChildElements() : wrapperInfo.getOutputChildElements();
        HelperContext helperContext = SDOContextHelper.getHelperContext(operation);
View Full Code Here

                // not be an issue. 
                if (matchingWsdlOp.isInputWrapperStyle()) {
                    if (op.getInputType().getLogical().size() == 1) {
                        // we only need to know what the wrapper is on the deserialization
                        // might need to change this when the input/output wrapper style is different
                        ElementInfo ei = op.getInputWrapper().getWrapperElement();
                        String namespace = ei.getQName().getNamespaceURI();
                        String opName = ei.getQName().getLocalPart();
                        OMNamespace ns = factory.createOMNamespace(namespace, "ns1");
                        OMElement wrapper = factory.createOMElement(opName, ns);
                        this.inputWrapperMap.put(name, wrapper);
                    }
                }
View Full Code Here

                }

                if (matchingWsdlOp.isOutputWrapperStyle()) {
                    // we only need to know what the wrapper is on the deserialization
                    // might need to change this when there input/output wrapper style is different
                    ElementInfo ei = op.getOutputWrapper().getWrapperElement();
                    String namespace = ei.getQName().getNamespaceURI();
                    String opName = ei.getQName().getLocalPart();
                    OMNamespace ns = factory.createOMNamespace(namespace, "ns2");
                    OMElement wrapper = factory.createOMElement(opName, ns);

                    this.outputWrapperMap.put(name, wrapper);
                }
View Full Code Here

        super.setUp();
        this.handler = new JAXBWrapperHandler();
    }

    public void testCreate() {
        ElementInfo element = new ElementInfo(ELEMENT, null);
        Operation op = new OperationImpl();
        WrapperInfo wrapperInfo = new WrapperInfo(JAXBDataBinding.NAME, element, null);
        wrapperInfo.setWrapperType(new DataTypeImpl<XMLType>(JAXBDataBinding.NAME, StockQuoteOffer.class,
                                                             XMLType.UNKNOWN));
        op.setInputWrapper(wrapperInfo);
View Full Code Here

        Assert.assertTrue(offer instanceof StockQuoteOffer);
    }

    public void testSetChild() {
        StockQuoteOffer wrapper = new StockQuoteOffer();
        handler.setChild(wrapper, 0, new ElementInfo(INPUT, null), "IBM");
        Assert.assertEquals("IBM", wrapper.getInput());
    }
View Full Code Here

TOP

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

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.