Examples of DataTypeImpl


Examples of org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl

        Class<?> physical = dataType.getPhysical();
        if (!physical.isArray() || physical == byte[].class) {
            return false;
        }
        Class<?> componentType = physical.getComponentType();
        DataType logical = new DataTypeImpl(componentType, dataType.getLogical());
        introspectType(logical, operation);
        dataType.setDataBinding("java:array");
        dataType.setLogical(logical);
        return true;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl

        Class<?> physical = dataType.getPhysical();
        if (!physical.isArray() || physical == byte[].class) {
            return false;
        }
        Class<?> componentType = physical.getComponentType();
        DataType logical = new DataTypeImpl(componentType, dataType.getLogical());
        introspectType(logical, operation);
        dataType.setDataBinding("java:array");
        dataType.setLogical(logical);
        return true;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl

        Object2JSON t1 = new Object2JSON();
        Object result = t1.transform(me, null);
        System.out.println(result);
        JSON2Object t2 = new JSON2Object();
        TransformationContext context = new TransformationContextImpl();
        context.setTargetDataType(new DataTypeImpl(MyBean.class, null));
        Object v = t2.transform(result.toString(), context);
        Assert.assertTrue(v instanceof MyBean);
        //        String json =
        //            "{\"age\":30,\"books\":[],\"friends\":[\"John\",\"Mike\"],\"name\":\"Me\",\"vip\":true,\"you\":{\"id\":123,\"name\":null}}";
        //        Assert.assertEquals(json, result.toString());
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl

        Object2JSON t1 = new Object2JSON();
        Object result = t1.transform("ABC", null);
        System.out.println(result);
        JSON2Object t2 = new JSON2Object();
        TransformationContext context = new TransformationContextImpl();
        context.setTargetDataType(new DataTypeImpl(String.class, null));
        Object v = t2.transform(result, context);
        Assert.assertTrue(v instanceof String);
        Assert.assertEquals("ABC", v);
    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl

        Object2JSON t1 = new Object2JSON();
        Object result = t1.transform(new String[] {"ABC", "DF"}, null);
        System.out.println(result);
        JSON2Object t2 = new JSON2Object();
        TransformationContext context = new TransformationContextImpl();
        context.setTargetDataType(new DataTypeImpl(String[].class, null));
        Object v = t2.transform(result, context);
        Assert.assertTrue(v instanceof String[]);
        String[] strs = (String[])v;
        Assert.assertEquals("ABC", strs[0]);
        Assert.assertEquals("DF", strs[1]);
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl

            dataBinding = dataType.getDataBinding();
            write(entityStream, t, type);
            return;
        }
        DataType targetDataType =
            new DataTypeImpl(dataBinding, OutputStream.class, OutputStream.class, OutputStream.class);
        // dataBindingExtensionPoint.introspectType(targetDataType, null);

        introspectAnnotations(annotations, targetDataType);

        mediator.mediate(t, entityStream, dataType, targetDataType, Collections.<String, Object> emptyMap());
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl

            dataBinding = targetDataType.getDataBinding();
            source = convert(entityStream, mediaType.toString(), type);
            return (T) source;
        }
        DataType sourceDataType =
            new DataTypeImpl(dataBinding, InputStream.class, InputStream.class, InputStream.class);

        Object result = mediator.mediate(source, sourceDataType, targetDataType, Collections.<String, Object>emptyMap());
        return (T)result;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl

        Class physical = dataType.getPhysical();
        if (!physical.isArray() || physical == byte[].class) {
            return false;
        }
        Class componentType = physical.getComponentType();
        DataType logical = new DataTypeImpl(componentType, dataType.getLogical());
        introspectType(logical, annotations);
        dataType.setDataBinding("java:array");
        dataType.setLogical(logical);
        return true;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl

        Type genericComponentType = componentType;
       
        if(dataType.getGenericType() instanceof GenericArrayType) {
            genericComponentType = ((GenericArrayType) dataType.getGenericType()).getGenericComponentType();
        }
        DataType logical = new DataTypeImpl(dataType.getDataBinding(), componentType, genericComponentType, dataType.getLogical());
        introspectType(logical, operation);
        dataType.setDataBinding("java:array");
        dataType.setLogical(logical);
        return true;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl

        Class physical = dataType.getPhysical();
        if (!physical.isArray() || physical == byte[].class) {
            return false;
        }
        Class componentType = physical.getComponentType();
        DataType logical = new DataTypeImpl(componentType, dataType.getLogical());
        introspectType(logical, operation);
        dataType.setDataBinding("java:array");
        dataType.setLogical(logical);
        return true;
    }
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.