Package org.apache.camel.builder
Class ValidatorBuilder
java.lang.Object
org.apache.camel.builder.ValidatorBuilder
A Java DSL which is used to build a
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(org.apache.camel.CamelContext camelContext) Configures a new Validator according to the configurations built on this builder and register it into the givenCamelContext
.Set the data type using Java class.Set the data type name.Set the Java Bean name to be used for customValidator
.withExpression
(org.apache.camel.Expression expression) Set theExpression
to be used for the predicateValidator
.withExpression
(org.apache.camel.Predicate predicate) Set thePredicate
to be used for the predicateValidator
.Set the JavaClass
represents a customValidator
implementation class.Set the URI to be used for the endpointValidator
.
-
Constructor Details
-
ValidatorBuilder
public ValidatorBuilder()
-
-
Method Details
-
type
Set the data type name. If you specify 'xml:XYZ', the validator will be picked up if source type is 'xml:XYZ'. If you specify just 'xml', the validator matches with all of 'xml' source type like 'xml:ABC' or 'xml:DEF'.- Parameters:
type
- 'from' data type name
-
type
Set the data type using Java class.- Parameters:
type
- Java class represents data type
-
withUri
Set the URI to be used for the endpointValidator
.- Parameters:
uri
- endpoint URI
-
withExpression
Set theExpression
to be used for the predicateValidator
.- Parameters:
expression
- validation expression
-
withExpression
Set thePredicate
to be used for the predicateValidator
.- Parameters:
predicate
- validation predicate
-
withJava
Set the JavaClass
represents a customValidator
implementation class.- Parameters:
clazz
-Class
object represents custom validator implementation- See Also:
-
withBean
Set the Java Bean name to be used for customValidator
.- Parameters:
ref
- bean name for the customValidator
- See Also:
-
configure
public void configure(org.apache.camel.CamelContext camelContext) Configures a new Validator according to the configurations built on this builder and register it into the givenCamelContext
.- Parameters:
camelContext
- the given CamelContext
-