Package org.switchyard.config.model.transform.v1

Examples of org.switchyard.config.model.transform.v1.V1TransformsModel


     * @param transformerRegistry SwitchYard's {@link TransformerRegistry}.
     *
     * @return {@link TransformsModel} the populated TransformsModel
     */
    public TransformsModel getTransformsModel(final TransformerRegistry transformerRegistry) {
        final TransformsModel transforms = new V1TransformsModel(TransformNamespace.DEFAULT.uri());
        for (Entry<QName, Set<QName>> entry : getTransformTypes().entrySet()) {
            final QName from = entry.getKey();
            final Set<QName> toTypes = entry.getValue();
            for (QName to : toTypes) {
                final V1JavaTransformModel transform = new V1JavaTransformModel(TransformNamespace.DEFAULT.uri());
                transform.setFrom(from);
                transform.setTo(to);
                transform.setClazz(CamelTransformer.class.getName());
                if (!isTransformRegistred(transform, transformerRegistry)) {
                    transforms.addTransform(transform);
                }
            }
        }
        return transforms;
    }
View Full Code Here


        String name = config.getName();
        Descriptor desc = getDescriptor();
        if (name.equals(SwitchYardModel.SWITCHYARD)) {
            return new V1SwitchYardModel(config, desc);
        } else if (name.equals(TransformsModel.TRANSFORMS)) {
            return new V1TransformsModel(config, desc);
        } else if (name.equals(ValidatesModel.VALIDATES)) {
            return new V1ValidatesModel(config, desc);
        } else if (name.equals(ArtifactsModel.ARTIFACTS)) {
            return new V1ArtifactsModel(config, desc);
        } else if (name.equals(ArtifactModel.ARTIFACT)) {
View Full Code Here

                }
                transformModel.setFrom(supportedTransform.getFrom());
                transformModel.setTo(supportedTransform.getTo());

                if (transformsModel == null) {
                    transformsModel = new V1TransformsModel(switchyardNamespace.uri());
                    switchyardModel.setTransforms(transformsModel);
                }
                transformsModel.addTransform(transformModel);
            }
        }
View Full Code Here

    }

    @Test
    public void testCreate() throws Exception {
        SwitchYardModel switchyard = new V1SwitchYardModel(SwitchYardNamespace.V_1_0.uri());
        TransformsModel transforms = new V1TransformsModel(SwitchYardNamespace.V_1_0.uri());
        JavaTransformModel javaTransform = new V1JavaTransformModel(TransformNamespace.V_1_0.uri());
        javaTransform.setFrom(new QName("msgA"));
        javaTransform.setTo(new QName("msgB"));
        javaTransform.setClazz("org.examples.transform.AtoBTransform");
        transforms.addTransform(javaTransform);
        SmooksTransformModel smooksTransform = new V1SmooksTransformModel(TransformNamespace.V_1_0.uri());
        smooksTransform.setFrom(new QName("msgC"));
        smooksTransform.setTo(new QName("msgD"));
        smooksTransform.setTransformType("XML2JAVA");
        smooksTransform.setConfig("/trasnforms/xxx.xml");
        smooksTransform.setReportPath("/tmp/smooksreport.html");
        transforms.addTransform(smooksTransform);
        switchyard.setTransforms(transforms);
        String new_xml = switchyard.toString();
        String old_xml = new ModelPuller<SwitchYardModel>().pull(XML, getClass()).toString();
        XMLUnit.setIgnoreWhitespace(true);
        Diff diff = XMLUnit.compareXML(old_xml, new_xml);
View Full Code Here

TOP

Related Classes of org.switchyard.config.model.transform.v1.V1TransformsModel

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.