Package org.apache.camel.model

Examples of org.apache.camel.model.ConvertBodyDefinition


    private ConvertBodyDefinitionRenderer() {
        // Utility class, no public or protected default constructor
    }   

    public static void render(StringBuilder buffer, ProcessorDefinition processor) {
        ConvertBodyDefinition convertBody = (ConvertBodyDefinition)processor;
        buffer.append(".").append(convertBody.getShortName()).append("(");
        if (convertBody.getType().equals("[B")) {
            buffer.append("byte[].class");
        } else {
            buffer.append(convertBody.getType()).append(".class");
        }
        if (convertBody.getCharset() != null) {
            buffer.append(", \"").append(convertBody.getCharset()).append("\"");
        }
        buffer.append(")");
    }
View Full Code Here


    private ConvertBodyDefinitionRenderer() {
        // Utility class, no public or protected default constructor
    }   

    public static void render(StringBuilder buffer, ProcessorDefinition<?> processor) {
        ConvertBodyDefinition convertBody = (ConvertBodyDefinition)processor;
        buffer.append(".").append(convertBody.getShortName()).append("(");
        if (convertBody.getType().equals("[B")) {
            buffer.append("byte[].class");
        } else {
            buffer.append(convertBody.getType()).append(".class");
        }
        if (convertBody.getCharset() != null) {
            buffer.append(", \"").append(convertBody.getCharset()).append("\"");
        }
        buffer.append(")");
    }
View Full Code Here

    }

    @SuppressWarnings("rawtypes")
    @Override
    public ProcessorDefinition createCamelDefinition() {
        ConvertBodyDefinition answer = new ConvertBodyDefinition();

        answer.setType(toXmlPropertyValue(PROPERTY_TYPE, this.getType()));
        answer.setCharset(toXmlPropertyValue(PROPERTY_CHARSET, this.getCharset()));

        super.savePropertiesToCamelDefinition(answer);
        return answer;
    }
View Full Code Here

    @Override
    protected void loadPropertiesFromCamelDefinition(ProcessorDefinition processor) {
        super.loadPropertiesFromCamelDefinition(processor);

        if (processor instanceof ConvertBodyDefinition) {
            ConvertBodyDefinition node = (ConvertBodyDefinition) processor;

            this.setType(node.getType());
            this.setCharset(node.getCharset());
        } else {
            throw new IllegalArgumentException("ProcessorDefinition not an instanceof ConvertBodyDefinition. Was " + processor.getClass().getName());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.model.ConvertBodyDefinition

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.