
package org.apache.camel.reifier.dataformat;

import java.util.Map;

import org.apache.camel.CamelContext;
import org.apache.camel.model.DataFormatDefinition;
import org.apache.camel.model.dataformat.JacksonXMLDataFormat;

public class JacksonXMLDataFormatReifier extends DataFormatReifier<JacksonXMLDataFormat> {

    public JacksonXMLDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
        super(camelContext, (JacksonXMLDataFormat) definition);
    }

    @Override
    protected void prepareDataFormatConfig(Map<String, Object> properties) {
        properties.put("xmlMapper", definition.getXmlMapper());
        properties.put("unmarshalType", or(definition.getUnmarshalType(), definition.getUnmarshalTypeName()));
        properties.put("jsonView", or(definition.getJsonView(), definition.getJsonViewTypeName()));
        properties.put("prettyPrint", definition.getPrettyPrint());
        properties.put("include", definition.getInclude());
        properties.put("allowJmsType", definition.getAllowJmsType());
        properties.put("collectionType", or(definition.getCollectionType(), definition.getCollectionTypeName()));
        properties.put("useList", definition.getUseList());
        properties.put("enableJaxbAnnotationModule", definition.getEnableJaxbAnnotationModule());
        properties.put("modulesClassNames", definition.getModuleClassNames());
        properties.put("moduleRefs", definition.getModuleRefs());
        properties.put("enableFeatures", definition.getEnableFeatures());
        properties.put("disableFeatures", definition.getDisableFeatures());
        properties.put("allowUnmarshallType", definition.getAllowUnmarshallType());
    }

}
