Package org.apache.camel.builder
Class ValidatorBuilder
- java.lang.Object
-
- org.apache.camel.builder.ValidatorBuilder
-
-
Constructor Summary
Constructors Constructor Description ValidatorBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 givenCamelContext
.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 customValidator
.ValidatorBuilder
withExpression(org.apache.camel.Expression expression)
Set theExpression
to be used for the predicateValidator
.ValidatorBuilder
withExpression(org.apache.camel.Predicate predicate)
Set thePredicate
to be used for the predicateValidator
.ValidatorBuilder
withJava(Class<? extends org.apache.camel.spi.Validator> clazz)
Set the JavaClass
represents a customValidator
implementation class.ValidatorBuilder
withUri(String uri)
Set the URI to be used for the endpointValidator
.
-
-
-
Method Detail
-
type
public ValidatorBuilder type(String 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
public ValidatorBuilder type(Class<?> type)
Set the data type using Java class.- Parameters:
type
- Java class represents data type
-
withUri
public ValidatorBuilder withUri(String uri)
Set the URI to be used for the endpointValidator
.- Parameters:
uri
- endpoint URI
-
withExpression
public ValidatorBuilder withExpression(@AsPredicate org.apache.camel.Expression expression)
Set theExpression
to be used for the predicateValidator
.- Parameters:
expression
- validation expression
-
withExpression
public ValidatorBuilder withExpression(@AsPredicate org.apache.camel.Predicate predicate)
Set thePredicate
to be used for the predicateValidator
.- Parameters:
predicate
- validation predicate
-
withJava
public ValidatorBuilder withJava(Class<? extends org.apache.camel.spi.Validator> clazz)
Set the JavaClass
represents a customValidator
implementation class.- Parameters:
clazz
-Class
object represents custom validator implementation- See Also:
CustomValidatorDefinition
-
withBean
public ValidatorBuilder withBean(String ref)
Set the Java Bean name to be used for customValidator
.- Parameters:
ref
- bean name for the customValidator
- See Also:
CustomValidatorDefinition
-
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
-
-