Package org.mule.transformer

Examples of org.mule.transformer.CompositeConverter


    {
        for (Converter converter : converters)
        {
            if (converter instanceof CompositeConverter)
            {
                CompositeConverter compositeConverter = (CompositeConverter) converter;
                if (compositeConverter.getConverters().size() != composedConverters.length)
                {
                    continue;
                }

                boolean matches = true;
                for (int i = 0; i < composedConverters.length - 1; i++)
                {
                    if (composedConverters[i] != compositeConverter.getConverters().get(i))
                    {
                        matches = false;
                        break;
                    }
                }
View Full Code Here


        graphResolver.transformerChange(stringToJson, TransformerResolver.RegistryAction.ADDED);

        Transformer transformer = graphResolver.resolve(XML_DATA_TYPE, JSON_DATA_TYPE);

        assertTrue(transformer instanceof CompositeConverter);
        CompositeConverter compositeConverter = (CompositeConverter) transformer;
        assertEquals(2, compositeConverter.getConverters().size());
        assertEquals(xmlToInputStream, compositeConverter.getConverters().get(0));
        assertEquals(inputStreamToJson, compositeConverter.getConverters().get(1));
    }
View Full Code Here

        graphResolver.transformerChange(stringToJson, TransformerResolver.RegistryAction.ADDED);

        Transformer transformer = graphResolver.resolve(XML_DATA_TYPE, JSON_DATA_TYPE);

        assertTrue(transformer instanceof CompositeConverter);
        CompositeConverter compositeConverter = (CompositeConverter) transformer;
        assertEquals(2, compositeConverter.getConverters().size());
        assertEquals(xmlToInputStream, compositeConverter.getConverters().get(0));
        assertEquals(inputStreamToJson, compositeConverter.getConverters().get(1));
    }
View Full Code Here

        Converter xmlToString = new MockConverterBuilder().named("xmlToString").from(XML_DATA_TYPE).to(STRING_DATA_TYPE).build();
        Converter stringToJson = new MockConverterBuilder().named("stringToJson").from(STRING_DATA_TYPE).to(JSON_DATA_TYPE).build();

        List<Converter> availableConverters = new ArrayList<Converter>();
        availableConverters.add(xmlToString);
        CompositeConverter compositeConverter = new CompositeConverter(xmlToString, stringToJson);
        availableConverters.add(compositeConverter);

        List<Converter> transformers = filter.filter(availableConverters, UNUSED_DATA_TYPE, UNUSED_DATA_TYPE);

        assertEquals(1, transformers.size());
View Full Code Here

    {
        Converter xmlToString = new MockConverterBuilder().named("xmlToString").from(XML_DATA_TYPE).to(STRING_DATA_TYPE).build();
        Converter stringToJson = new MockConverterBuilder().named("stringToJson").from(STRING_DATA_TYPE).to(JSON_DATA_TYPE).build();

        List<Converter> availableConverters = new ArrayList<Converter>();
        CompositeConverter compositeConverter = new CompositeConverter(xmlToString, stringToJson);
        availableConverters.add(compositeConverter);
        availableConverters.add(xmlToString);

        List<Converter> transformers = filter.filter(availableConverters, UNUSED_DATA_TYPE, UNUSED_DATA_TYPE);
View Full Code Here

            {
                converter = transformationPath.get(0).getConverter();
            }
            else
            {
                converter = new CompositeConverter(pathConverters);
            }
            converters.add(converter);
        }

        return converters;
View Full Code Here

TOP

Related Classes of org.mule.transformer.CompositeConverter

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.