Package org.apache.camel.model

Examples of org.apache.camel.model.SetBodyDefinition


                SplitDefinition split = (SplitDefinition) definition;
                split.addOutput(new ToDefinition("mock:extra"));
            }

            if (definition instanceof SetBodyDefinition) {
                SetBodyDefinition set = (SetBodyDefinition) definition;
                set.setExpression(new ConstantExpression("body was altered"));
            }

            // return null to let the default implementation create the processor, we just wanted to alter the definition
            // before the processor was created
            return null;
View Full Code Here


                SplitDefinition split = (SplitDefinition) definition;
                split.addOutput(new ToDefinition("mock:extra"));
            }

            if (definition instanceof SetBodyDefinition) {
                SetBodyDefinition set = (SetBodyDefinition) definition;
                set.setExpression(new ConstantExpression("body was altered"));
            }

            // return null to let the default implementation create the processor, we just wanted to alter the definition
            // before the processor was created
            return null;
View Full Code Here

        public int getInvoked() {
            return invoked;
        }

        public void beforeWrap(RouteContext routeContext, ProcessorDefinition<?> definition) {
            SetBodyDefinition bodyDef = (SetBodyDefinition) definition.getOutputs().get(0);
            bodyDef.setExpression(new ConstantExpression("body was altered"));
        }
View Full Code Here

        public int getInvoked() {
            return invoked;
        }

        public void beforeWrap(RouteContext routeContext, ProcessorDefinition<?> definition) {
            SetBodyDefinition bodyDef = (SetBodyDefinition) definition.getOutputs().get(0);
            bodyDef.setExpression(new ConstantExpression("body was altered"));
        }
View Full Code Here

                SplitDefinition split = (SplitDefinition) definition;
                split.addOutput(new ToDefinition("mock:extra"));
            }

            if (definition instanceof SetBodyDefinition) {
                SetBodyDefinition set = (SetBodyDefinition) definition;
                set.setExpression(new ConstantExpression("body was altered"));
            }

            // return null to let the default implementation create the processor, we just wanted to alter the definition
            // before the processor was created
            return null;
View Full Code Here

        public int getInvoked() {
            return invoked;
        }

        public void beforeWrap(RouteContext routeContext, ProcessorDefinition<?> definition) {
            SetBodyDefinition bodyDef = (SetBodyDefinition) definition.getOutputs().get(0);
            bodyDef.setExpression(new ConstantExpression("body was altered"));
        }
View Full Code Here

    }

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

        answer.setInheritErrorHandler(toXmlPropertyValue(PROPERTY_INHERITERRORHANDLER, Objects.<Boolean>getField(this, "inheritErrorHandler")));
        answer.setExpression(toXmlPropertyValue(PROPERTY_EXPRESSION, this.getExpression()));

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

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

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

            this.setInheritErrorHandler(Objects.<Boolean>getField(node, "inheritErrorHandler"));
            this.setExpression(node.getExpression());
        } else {
            throw new IllegalArgumentException("ProcessorDefinition not an instanceof SetBodyDefinition. Was " + processor.getClass().getName());
        }
    }
View Full Code Here

TOP

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

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.