Package org.apache.camel.model

Examples of org.apache.camel.model.ThrowExceptionDefinition


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

    public static void render(StringBuilder buffer, ProcessorDefinition processor) {
        ThrowExceptionDefinition throwExp = (ThrowExceptionDefinition)processor;
        buffer.append(".").append(throwExp.getShortName()).append("(");
        String expName = throwExp.getException().getClass().getSimpleName();
        String msg = throwExp.getException().getMessage();
        buffer.append("new ").append(expName).append("(\"").append(msg).append("\"))");
    }
View Full Code Here


    }

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

        answer.setRef(toXmlPropertyValue(PROPERTY_REF, this.getRef()));

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

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

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

            this.setRef(node.getRef());
        } else {
            throw new IllegalArgumentException("ProcessorDefinition not an instanceof ThrowExceptionDefinition. Was " + processor.getClass().getName());
        }
    }
View Full Code Here

TOP

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

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.