Package org.apache.tuscany.api.annotation

Examples of org.apache.tuscany.api.annotation.DataType.context()


                                  Map<String, Operation<Type>> operations) {
        DataType interfaceDataType = clazz.getAnnotation(DataType.class);
        if (interfaceDataType != null) {
            contract.setDataBinding(interfaceDataType.name());
            // FIXME: [rfeng] Keep data context as metadata?
            for (DataContext c : interfaceDataType.context()) {
                contract.setMetaData(c.key(), c.value());
            }
        }
        for (Method method : clazz.getMethods()) {
            Operation<?> operation = operations.get(method.getName());
View Full Code Here


            DataType operationDataType = method.getAnnotation(DataType.class);

            if (operationDataType != null) {
                operation.setDataBinding(operationDataType.name());
                // FIXME: [rfeng] Keep data context as metadata?
                for (DataContext c : operationDataType.context()) {
                    operation.setMetaData(c.key(), c.value());
                }
            }

            String dataBinding = operation.getDataBinding();
View Full Code Here

    @SuppressWarnings("unused")
    public void testDataType() throws Exception {
        Class<Test> testClass = Test.class;
        DataType d = testClass.getAnnotation(DataType.class);
        Assert.assertEquals(d.name(), "sdo");
        Assert.assertEquals(d.context().length, 0);

        Method method = testClass.getMethod("test", new Class[] {Object.class});
        DataType d2 = method.getAnnotation(DataType.class);
        Assert.assertEquals(d2.name(), "jaxb");
        Assert.assertEquals(d2.context()[0].key(), "contextPath");
View Full Code Here

        Assert.assertEquals(d.context().length, 0);

        Method method = testClass.getMethod("test", new Class[] {Object.class});
        DataType d2 = method.getAnnotation(DataType.class);
        Assert.assertEquals(d2.name(), "jaxb");
        Assert.assertEquals(d2.context()[0].key(), "contextPath");
        Assert.assertEquals(d2.context()[0].value(), "com.example.ipo.jaxb");
    }

    @DataType(name = "sdo")
    private static interface Test {
View Full Code Here

        Method method = testClass.getMethod("test", new Class[] {Object.class});
        DataType d2 = method.getAnnotation(DataType.class);
        Assert.assertEquals(d2.name(), "jaxb");
        Assert.assertEquals(d2.context()[0].key(), "contextPath");
        Assert.assertEquals(d2.context()[0].value(), "com.example.ipo.jaxb");
    }

    @DataType(name = "sdo")
    private static interface Test {
        @DataType(name = "jaxb", context = {@DataContext(key = "contextPath", value = "com.example.ipo.jaxb")})
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.