Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Bean Validation Component - Camel 2.3 onwards

The Validation component performs bean validation of the message body using the Java Bean Validation API (JSR 303). Camel uses the reference implementation, which is Hibernate Validator.

URI format

Code Block
bean-validator:something

...

You can append query options to the URI in the following format, ?option=value&option=value&...

URI Options

Option

Default

Description

group

javax.validation.groups.Default

The custom validation group to use.

messageInterpolator

org.hibernate.validator.engine.ResourceBundleMessageInterpolator

Reference to a custom javax.validation.MessageInterpolator in the Registry.

traversableResolver

org.hibernate.validator.engine.resolver.DefaultTraversableResolver

Reference to a custom javax.validation.TraversableResolver in the Registry.

constraintValidatorFactory

org.hibernate.validator.engine.ConstraintValidatorFactoryImpl

Reference to a custom javax.validation.ConstraintValidatorFactory in the Registry.

Example

Assumed we have a java bean with the following annotations

...