Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Where label is an arbitrary text value describing the endpoint.
You can append query options to the URI in the following format, ?option=value&option=value&...

URI Options

Div
classconfluenceTableSmall
Wiki Markup
{div:class=confluenceTableSmall} || Option || Default || Description || | {{group}} | {{

Option

Default

Description

group

javax.validation.groups.Default

}} |

The

custom

validation

group

to

use.

| | {{validationProviderResolver}} | Depends on JSR303 jar provided. | Camel *

validationProviderResolver

Depends on JSR303 jar provided.

Camel 2.13.0

*

:

Reference

to

a

custom

{{

javax.validation.ValidationProviderResolver

}}

in

the

[]. | | {{messageInterpolator}} | {{

.

messageInterpolator

org.hibernate.validator.engine.

\\ResourceBundleMessageInterpolator}} | Reference to a custom {{


ResourceBundleMessageInterpolator

Reference to a custom javax.validation.MessageInterpolator

}}

in

the

[]. | | {{traversableResolver}} | {{

.

traversableResolver

org.hibernate.validator.engine.resolver.

\\DefaultTraversableResolver}} | Reference to a custom {{


DefaultTraversableResolver

Reference to a custom javax.validation.TraversableResolver

}}

in

the

[]. | | {{constraintValidatorFactory}} | {{

.

constraintValidatorFactory

org.hibernate.validator.engine.

\\ConstraintValidatorFactoryImpl}} | Reference to a custom {{


ConstraintValidatorFactoryImpl

Reference to a custom javax.validation.ConstraintValidatorFactory

}}

in

the

[]

.

| {div}

...

OSGi

...

deployment

To use

The bean-validator when deployed in an OSGi environment requires a little help to accommodate the resource loading specified in JSR303, this was fixed in Servicemix-Specs 1.6-SNAPSHOT.

The other way to load Hibernate Validator in the OSGi environment is to use dedicated ValidationProviderResolver implementation, just as org.apache.camel.component.bean.validator.HibernateValidationProviderResolver. The snippet below demonstrates this approach. Keep in mind that you can use HibernateValidationProviderResolver starting from the Camel 2.13.0.

Code Block
titleUsing HibernateValidationProviderResolver
from("direct:test").
  to("bean-validator://ValidationProviderResolverTest?validationProviderResolver=#myValidationProviderResolver");

...

<bean id="myValidationProviderResolver" class="org.apache.camel.component.bean.validator.HibernateValidationProviderResolver"/> 

If no custom ValidationProviderResolver is defined and the validator component has been deployed into the OSGi environment, the HibernateValidationProviderResolver will be automatically used.

Example

Assumed we have a java bean with the following annotations

...