Bean ValidationPage edited by Christian MuellerBean Validation Component - Camel 2.3 onwardsThe 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 formator
You can append query options to the URI in the following format, ?option=value&option=value&... URI Options
ExampleAssumed we have a java bean with the following annotations Car.java and an interface definition for our custom validation group OptionalChecks.java with the following Camel route, only the @NotNull constraints on the attributes manufacturer and licensePlate will be validated (Camel uses the default group javax.validation.groups.Default). If you want to check the constraints from the group OptionalChecks, you have to define the route like this If you want to check the constraints from both groups, you have to define a new interface first AllChecks.java and then your route definition should looks like this And if you have to provide your own message interpolator, traversable resolver and constraint validator factory, you have to write a route like this See Also
Change Notification Preferences
View Online
|
View Change
|
Add Comment
|
- [CONF] Apache Camel > Bean Validation confluence
- [CONF] Apache Camel > Bean Validation confluence
- [CONF] Apache Camel > Bean Validation confluence
- [CONF] Apache Camel > Bean Validation confluence