Search in sources :

Example 1 with ProcessorValidator

use of org.apache.camel.impl.validator.ProcessorValidator in project camel by apache.

the class EndpointValidatorDefinition method doCreateValidator.

@Override
protected Validator doCreateValidator(CamelContext context) throws Exception {
    Endpoint endpoint = uri != null ? context.getEndpoint(uri) : context.getRegistry().lookupByNameAndType(ref, Endpoint.class);
    SendProcessor processor = new SendProcessor(endpoint, ExchangePattern.InOut);
    return new ProcessorValidator(context).setProcessor(processor).setType(getType());
}
Also used : ValidatorEndpoint(org.apache.camel.component.validator.ValidatorEndpoint) Endpoint(org.apache.camel.Endpoint) ProcessorValidator(org.apache.camel.impl.validator.ProcessorValidator) SendProcessor(org.apache.camel.processor.SendProcessor)

Example 2 with ProcessorValidator

use of org.apache.camel.impl.validator.ProcessorValidator in project camel by apache.

the class PredicateValidatorDefinition method doCreateValidator.

@Override
protected Validator doCreateValidator(CamelContext context) throws Exception {
    Predicate pred = getExpression().createPredicate(context);
    PredicateValidatingProcessor processor = new PredicateValidatingProcessor(pred);
    return new ProcessorValidator(context).setProcessor(processor).setType(getType());
}
Also used : PredicateValidatingProcessor(org.apache.camel.processor.validation.PredicateValidatingProcessor) ProcessorValidator(org.apache.camel.impl.validator.ProcessorValidator) Predicate(org.apache.camel.Predicate)

Aggregations

ProcessorValidator (org.apache.camel.impl.validator.ProcessorValidator)2 Endpoint (org.apache.camel.Endpoint)1 Predicate (org.apache.camel.Predicate)1 ValidatorEndpoint (org.apache.camel.component.validator.ValidatorEndpoint)1 SendProcessor (org.apache.camel.processor.SendProcessor)1 PredicateValidatingProcessor (org.apache.camel.processor.validation.PredicateValidatingProcessor)1