public class ValidatorBuilder extends Object
Validator
and register into
CamelContext
. It requires a 'type' to be specified
by type() method. And then you can choose a type of validator by withUri(),
withPredicate(), withJava() or withBean() method.Constructor and Description |
---|
ValidatorBuilder() |
Modifier and Type | Method and Description |
---|---|
void |
configure(org.apache.camel.CamelContext camelContext)
Configures a new Validator according to the configurations built on this
builder and register it into the given
CamelContext . |
ValidatorBuilder |
type(Class<?> type)
Set the data type using Java class.
|
ValidatorBuilder |
type(String type)
Set the data type name.
|
ValidatorBuilder |
withBean(String ref)
Set the Java Bean name to be used for custom
Validator . |
ValidatorBuilder |
withExpression(org.apache.camel.Expression expression)
Set the
Expression to be used for the predicate
Validator . |
ValidatorBuilder |
withExpression(org.apache.camel.Predicate predicate)
Set the
Predicate to be used for the predicate Validator . |
ValidatorBuilder |
withJava(Class<? extends org.apache.camel.spi.Validator> clazz)
Set the Java
Class represents a custom Validator
implementation class. |
ValidatorBuilder |
withUri(String uri)
Set the URI to be used for the endpoint
Validator . |
public ValidatorBuilder()
public ValidatorBuilder type(String type)
type
- 'from' data type namepublic ValidatorBuilder type(Class<?> type)
type
- Java class represents data typepublic ValidatorBuilder withUri(String uri)
Validator
.uri
- endpoint URIEndpointValidatorDefinition, ProcessorValidator
public ValidatorBuilder withExpression(@AsPredicate org.apache.camel.Expression expression)
Expression
to be used for the predicate
Validator
.expression
- validation expressionPredicateValidatorDefinition, ProcessorValidator
public ValidatorBuilder withExpression(@AsPredicate org.apache.camel.Predicate predicate)
Predicate
to be used for the predicate Validator
.predicate
- validation predicatePredicateValidatorDefinition, ProcessorValidator
public ValidatorBuilder withJava(Class<? extends org.apache.camel.spi.Validator> clazz)
Class
represents a custom Validator
implementation class.clazz
- Class
object represents custom validator
implementationCustomValidatorDefinition
public ValidatorBuilder withBean(String ref)
Validator
.ref
- bean name for the custom Validator
CustomValidatorDefinition
public void configure(org.apache.camel.CamelContext camelContext)
CamelContext
.camelContext
- the given CamelContextApache Camel