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

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


        String partName = input ? operation.getName() : (operation.getName() + "Response");
        part.setName(partName);
        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();
        if ((inputWrapperInfo != null) && (outputWrapperInfo != null)) {
            ElementInfo elementInfo =
                input ? inputWrapperInfo.getWrapperElement() : outputWrapperInfo.getWrapperElement();
            List<ElementInfo> elements =
                input ? inputWrapperInfo.getChildElements() : outputWrapperInfo.getChildElements();
            QName wrapperName = elementInfo.getQName();
            part.setElementName(wrapperName);
            addNamespace(definition, wrapperName);
            wrappers.put(wrapperName, elements);

            // FIXME: [rfeng] Ideally, we should try to register the wrappers only. But we are
View Full Code Here


                    XMLType xmlType = (XMLType)dataType.getLogical();
                    if (xmlType.getElementName() != null) {
                        element = xmlType.getElementName();
                    }
                }
                return new ElementInfo(element, new TypeInfo(ANYTYPE_QNAME, false, null));
                // throw new ServiceRuntimeException("No data binding for " + db);
            }

            helper = dataBinding.getXMLTypeHelper();
            if (helper == null) {
                // Default to JAXB
                helper = helpers.get(JAXBDataBinding.NAME);
                if (helper == null) {
                    helper = dataBindings.getDataBinding(JAXBDataBinding.NAME).getXMLTypeHelper();
                    helpers.put(JAXBDataBinding.NAME, helper);
                }
            }
            helpers.put(db, helper);
        }
        TypeInfo typeInfo = helper.getTypeInfo(javaType.isArray() ? javaType.getComponentType() : javaType,
                                               dataType.getLogical());
        ElementInfo element = new ElementInfo(name, typeInfo);
        element.setMany(byte[].class != javaType && javaType.isArray());
        element.setNillable(!javaType.isPrimitive());
        return element;
    }
View Full Code Here

    private JAXBWrapperHelper helper = new JAXBWrapperHelper();

    public Object create(Operation operation, boolean input) {
        WrapperInfo inputWrapperInfo = operation.getInputWrapper();
        WrapperInfo outputWrapperInfo = operation.getOutputWrapper();
        ElementInfo element = input ? inputWrapperInfo.getWrapperElement() : outputWrapperInfo.getWrapperElement();
        final Class<?> wrapperClass = input ? inputWrapperInfo.getWrapperClass() : outputWrapperInfo.getWrapperClass();
        try {
            if (wrapperClass == null) {
                return null;
            }
View Full Code Here

        List<ElementInfo> childElements =
            input ? operation.getInputWrapper().getChildElements() : operation.getOutputWrapper().getChildElements();
        List<String> childNames = new ArrayList<String>();
        Map<String, Object> values = new HashMap<String, Object>();
        for (int i = 0; i < childElements.size(); i++) {
            ElementInfo e = childElements.get(i);
            String name = e.getQName().getLocalPart();
            childNames.add(name);
            values.put(name, childObjects[i]);
        }
        // Get the property descriptor map
        Map<String, JAXBPropertyDescriptor> pdMap = null;
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

     */
    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

        this.handler = new JAXBWrapperHandler();
    }

    @Test
    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

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.