Examples of DataBinding


Examples of org.apache.tuscany.sca.databinding.DataBinding

            copiedArg = argDataBinding.copy(arg);
        } else {
            copiedArg = arg;
            DataType<?> dataType = registry.introspectType(arg);
            if (dataType != null) {
                DataBinding binding = registry.getDataBinding(dataType.getDataBinding());
                if (binding != null) {
                    copiedArg = binding.copy(arg);
                }
            }
            // FIXME: What to do if it's not recognized?
        }
        return copiedArg;
View Full Code Here

Examples of org.apache.tuscany.sca.databinding.DataBinding

            dataType = (DataType)dataType.getLogical();
            db = dataType.getDataBinding();
        }
        XMLTypeHelper helper = helpers.get(db);
        if (helper == null) {
            DataBinding dataBinding = dataBindings.getDataBinding(db);
            if (dataBinding == null) {
                QName element = name;
                if (element == null || dataType.getLogical() instanceof XMLType) {
                    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();
View Full Code Here

Examples of org.apache.tuscany.sca.databinding.annotation.DataBinding

        processInterface(javaInterface, operations);
    }

    private void processInterface(JavaInterface javaInterface, List<Operation> operations) {
        Class<?> clazz = javaInterface.getJavaClass();
        DataBinding dataBinding = clazz.getAnnotation(DataBinding.class);
        String dataBindingId = null;
        boolean wrapperStyle = false;
        if (dataBinding != null) {
            dataBindingId = dataBinding.value();
            wrapperStyle = dataBinding.wrapped();
        }

        Map<String, Operation> opMap = new HashMap<String, Operation>();
        for (Operation op : javaInterface.getOperations()) {
            opMap.put(op.getName(), op);
            // In the case of @WebMethod, the method name can be different from the operation name
            if (op instanceof JavaOperation) {
                opMap.put(((JavaOperation)op).getJavaMethod().getName(), op);
            }
            if (dataBindingId != null) {
                op.setDataBinding(dataBindingId);
                op.setWrapperStyle(wrapperStyle);
            }
        }
        for (Method method : clazz.getMethods()) {
            if (method.getDeclaringClass() == Object.class) {
                continue;
            }
            Operation operation = opMap.get(method.getName());
            DataBinding methodDataBinding = clazz.getAnnotation(DataBinding.class);
            if (methodDataBinding == null) {
                methodDataBinding = dataBinding;
            }
            dataBindingId = null;
            wrapperStyle = false;
View Full Code Here

Examples of org.apache.tuscany.sca.databinding.annotation.DataBinding

        processInterface(javaInterface, operations);
    }

    private void processInterface(JavaInterface javaInterface, List<Operation> operations) {
        Class<?> clazz = javaInterface.getJavaClass();
        DataBinding dataBinding = clazz.getAnnotation(DataBinding.class);
        String dataBindingId = null;
        boolean wrapperStyle = false;
        if (dataBinding != null) {
            dataBindingId = dataBinding.value();
            wrapperStyle = dataBinding.wrapped();
        }

        for (Operation op : javaInterface.getOperations()) {
            JavaOperation operation = (JavaOperation) op;
            // In the case of @WebMethod, the method name can be different from the operation name

            if (dataBindingId != null) {
                op.setDataBinding(dataBindingId);
                op.setWrapperStyle(wrapperStyle);
            }

            Method method = operation.getJavaMethod();

            DataBinding methodDataBinding = clazz.getAnnotation(DataBinding.class);
            if (methodDataBinding == null) {
                methodDataBinding = dataBinding;
            }
            dataBindingId = null;
            wrapperStyle = false;
View Full Code Here

Examples of org.apache.tuscany.spi.databinding.DataBinding

    }

    private WrapperHandler getWapperHandler(Operation<?> operation) {
        String dataBindingId;
        dataBindingId = operation.getDataBinding();
        DataBinding dataBinding = dataBindingRegistry.getDataBinding(dataBindingId);
        WrapperHandler wrapperHandler = dataBinding == null ? null : dataBinding.getWrapperHandler();
        if (wrapperHandler == null) {
            throw new TransformationException(
                                              "No wrapper handler is provided for databinding: " + dataBindingId);
        }
        return wrapperHandler;
View Full Code Here

Examples of org.eclipse.e4.xwt.databinding.DataBinding

      }
    } catch (XWTException e) {
      // in case the property cannot be bound. return value
    }

    DataBinding dataBinding = null;
    if (dataProvider != null
        && (path != null || dataContext instanceof IObservable)) {
      dataBinding = new DataBinding(this, dataProvider);
    }
    if (dataBinding != null) {
      return dataBinding.getValue(targetType);
    }
    return convertedValue(dataContext);
  }
View Full Code Here

Examples of org.opendope.xpaths.Xpaths.Xpath.DataBinding

   
    // XPath
    Xpaths.Xpath xp = new org.opendope.xpaths.ObjectFactory().createXpathsXpath();
    xp.setId(key);
    xp.setQuestionID(key);
    DataBinding db = new org.opendope.xpaths.ObjectFactory().createXpathsXpathDataBinding();
    db.setXpath("/oda:answers/oda:answer[@id='" + key +"']");
    db.setPrefixMappings("xmlns:oda='http://opendope.org/answers'");
    db.setStoreItemID(storeItemID);
    xp.setDataBinding(db);
    xPathsPart.getJaxbElement().getXpath().add(xp);
   
    // question
    Question q = new Question();
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.