Package org.apache.tuscany.sca.databinding

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


        Transformer t = registry.getTransformer("a", "b");
        Assert.assertSame(t, transformer);
    }

    public void testUnregisterTransformer() {
        Transformer transformer = createMock(Transformer.class);
        registry.addTransformer("a", "b", 10, transformer);
        boolean result = registry.removeTransformer("a", "b");
        Assert.assertTrue(result);
        Transformer t = registry.getTransformer("a", "b");
        Assert.assertNull(t);
    }
View Full Code Here


        Transformer t = registry.getTransformer("a", "b");
        Assert.assertNull(t);
    }

    public void testGetTransformerChain() {
        Transformer t1 = createMock(Transformer.class);
        expect(t1.getSourceDataBinding()).andReturn("a");
        expect(t1.getTargetDataBinding()).andReturn("b");
        expect(t1.getWeight()).andReturn(10);
        replay(t1);
        Transformer t2 = createMock(Transformer.class);
        expect(t2.getSourceDataBinding()).andReturn("b");
        expect(t2.getTargetDataBinding()).andReturn("c");
        expect(t2.getWeight()).andReturn(20);
        replay(t2);

        Transformer t3 = createMock(Transformer.class);
        expect(t3.getSourceDataBinding()).andReturn("a");
        expect(t3.getTargetDataBinding()).andReturn("c");
        expect(t3.getWeight()).andReturn(120);
        replay(t3);

        registry.addTransformer(t1);
        registry.addTransformer(t2);
        registry.addTransformer(t3);
View Full Code Here

        Object result = source;
        int size = path.size();
        int i = 0;
        while (i < size) {
            Transformer transformer = path.get(i);
            TransformationContext context =
                createTransformationContext(sourceDataType, targetDataType, size, i, transformer, metadata);
            // the source and target type
            if (transformer instanceof PullTransformer) {
                // For intermediate node, set data type to null
View Full Code Here

        List<Transformer> path = getTransformerChain(sourceDataType, targetDataType);
        Object result = source;
        int size = path.size();
        for (int i = 0; i < size; i++) {
            Transformer transformer = path.get(i);
            TransformationContext context =
                createTransformationContext(sourceDataType, targetDataType, size, i, transformer, metadata);

            if (transformer instanceof PullTransformer) {
                result = ((PullTransformer)transformer).transform(result, context);
View Full Code Here

        Object result = source;
        int size = path.size();
        int i = 0;
        while (i < size) {
            Transformer transformer = path.get(i);
            TransformationContext context =
                createTransformationContext(sourceDataType, targetDataType, size, i, transformer, metadata);
            // the source and target type
            if (transformer instanceof PullTransformer) {
                // For intermediate node, set data type to null
View Full Code Here

        List<Transformer> path = getTransformerChain(sourceDataType, targetDataType);
        Object result = source;
        int size = path.size();
        for (int i = 0; i < size; i++) {
            Transformer transformer = path.get(i);
            TransformationContext context =
                createTransformationContext(sourceDataType, targetDataType, size, i, transformer, metadata);

            if (transformer instanceof PullTransformer) {
                result = ((PullTransformer)transformer).transform(result, context);
View Full Code Here

        Object result = source;
        int size = path.size();
        int i = 0;
        while (i < size) {
            Transformer transformer = path.get(i);
            TransformationContext context =
                createTransformationContext(sourceDataType, targetDataType, size, i, transformer, metadata);
            // the source and target type
            if (transformer instanceof PullTransformer) {
                // For intermediate node, set data type to null
View Full Code Here

        List<Transformer> path = getTransformerChain(sourceDataType, targetDataType);
        Object result = source;
        int size = path.size();
        for (int i = 0; i < size; i++) {
            Transformer transformer = path.get(i);
            TransformationContext context =
                createTransformationContext(sourceDataType, targetDataType, size, i, transformer, metadata);

            if (transformer instanceof PullTransformer) {
                result = ((PullTransformer)transformer).transform(result, context);
View Full Code Here

        Object result = source;
        int size = path.size();
        int i = 0;
        while (i < size) {
            Transformer transformer = path.get(i);
            TransformationContext context =
                createTransformationContext(sourceDataType, targetDataType, size, i, transformer, metadata);
            // the source and target type
            if (transformer instanceof PullTransformer) {
                // For intermediate node, set data type to null
View Full Code Here

        List<Transformer> path = getTransformerChain(sourceDataType, targetDataType);
        Object result = source;
        int size = path.size();
        for (int i = 0; i < size; i++) {
            Transformer transformer = path.get(i);
            TransformationContext context =
                createTransformationContext(sourceDataType, targetDataType, size, i, transformer, metadata);

            if (transformer instanceof PullTransformer) {
                result = ((PullTransformer)transformer).transform(result, context);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.databinding.Transformer

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.