Package org.milyn

Examples of org.milyn.GenericReaderConfigurator.toConfig()


public class GenericReaderConfiguratorTest extends TestCase {

    public void test_resource_only() {
        GenericReaderConfigurator configurator = new GenericReaderConfigurator(JavaXMLReader.class);

        SmooksResourceConfiguration config = configurator.toConfig().get(0);
        assertConfigOK(config, JavaXMLReader.class.getName(), 0, 0, 0);
    }

    public void test_resource_and_features_and_params() throws SAXException {
        GenericReaderConfigurator configurator = new GenericReaderConfigurator(JavaXMLReader.class);
View Full Code Here


        configurator.setFeature("http://c", false);
        configurator.setFeature("http://d", true);
        configurator.setFeature("http://e", false);
        configurator.setFeature("http://f", false);

        SmooksResourceConfiguration config = configurator.toConfig().get(0);
        assertConfigOK(config, JavaXMLReader.class.getName(), 8, 3, 3);

        assertEquals("1", config.getStringParameter("a"));
        assertEquals("2", config.getStringParameter("b"));
View Full Code Here

        GenericReaderConfigurator configurator = new GenericReaderConfigurator();

        configurator.getParameters().setProperty("a", "1");
        configurator.setFeature("http://a", true);

        SmooksResourceConfiguration config = configurator.toConfig().get(0);
        assertConfigOK(config, null, 2, 1, 0);

        assertEquals("1", config.getStringParameter("a"));

        assertTrue(AbstractParser.isFeatureOn("http://a", config));
View Full Code Here

            }
        }

        configurator.setTargetProfile(targetProfile);

        return configurator.toConfig();
    }
}
View Full Code Here

        if(illegalElementNameCharReplacement != null) {
            configurator.getParameters().setProperty("illegalElementNameCharReplacement", illegalElementNameCharReplacement);
        }
        configurator.setTargetProfile(targetProfile);

        List<SmooksResourceConfiguration> configList = configurator.toConfig();
        SmooksResourceConfiguration config = configList.get(0);

        if(keyMap != null) {
            Parameter keyMapParam = new Parameter(YamlReader.CONFIG_PARAM_KEY_MAP, keyMap);
            config.setParameter(keyMapParam);
View Full Code Here

            }
        }

        configurator.setTargetProfile(targetProfile);

        return configurator.toConfig();
    }
}
View Full Code Here

        GenericReaderConfigurator configurator = new GenericReaderConfigurator(EDIReader.class);

        configurator.getParameters().setProperty(EDIReader.MODEL_CONFIG_KEY, mappingModel);
        configurator.setTargetProfile(targetProfile);

        return configurator.toConfig();
    }
}
View Full Code Here

            configurator.getParameters().setProperty("illegalElementNameCharReplacement", illegalElementNameCharReplacement);
        }
        configurator.getParameters().setProperty("nullValueReplacement", nullValueReplacement);
        configurator.getParameters().setProperty("encoding", encoding.name());

        List<SmooksResourceConfiguration> configList = configurator.toConfig();
        SmooksResourceConfiguration config = configList.get(0);

        if(keyMap != null) {
            Parameter keyMapParam = new Parameter(JSONReader.CONFIG_PARAM_KEY_MAP, keyMap);
            config.setParameter(keyMapParam);
View Full Code Here

        // Add the reader config...
        GenericReaderConfigurator configurator = new GenericReaderConfigurator(UNEdifactReader.class);
        configurator.getParameters().setProperty("mappingModel", mappingModel);
        configurator.setTargetProfile(targetProfile);
        configList.addAll(configurator.toConfig());       

        return configList;
    }
}
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.