[ https://issues.apache.org/activemq/browse/CAMEL-2565?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58772#action_58772 ]
Claus Ibsen commented on CAMEL-2565: ------------------------------------ Patch looks good, however there are a few minor spots 1) Loading class should use CamelContext.getClassResolver as it can handle OSGi environments and whatnot. You need to change this in the BeanValidatorComponent: {code} + if (group != null) { + beanValidator.setGroup(Class.forName(group)); + } {code} 2) You may want to use StringBuilder instead of StringBuffer as its _faster_, as its not synchronized. I often myself forget this and may use the old StringBuffer instead of the Builder. 3) In unit tests when casting like this {code} BeanValidationException exeption = (BeanValidationException) e.getCause(); {code} You can use the {{assertIsInstanceOf}} method instead which produces a nicer error message. > Create a new camel-bean-validation component (based on JSR 303) > --------------------------------------------------------------- > > Key: CAMEL-2565 > URL: https://issues.apache.org/activemq/browse/CAMEL-2565 > Project: Apache Camel > Issue Type: New Feature > Environment: All > Reporter: Christian Mueller > Assignee: Christian Mueller > Fix For: 2.3.0 > > Attachments: CAMEL-2565.patch, CAMEL-2565.patch, CAMEL-2565.patch > > > We want provide a validation component for java beans (POJOs) based on [JSR > 303|http://jcp.org/en/jsr/detail?id=303]. We want to use the reference > implementation, which is [Hibernate > Validator|http://docs.jboss.org/hibernate/stable/validator/reference/en/html_single/]. > The Hibernate Validator (the reference implementation for JSR 303) is > licensed under the Apache License Version 2: > http://anonsvn.jboss.org/repos/hibernate/validator/tags/v4_0_2_GA/license.txt > but not published as an OSGI bundle. So, I opened the issue > [SMX4-506]https://issues.apache.org/activemq/browse/SMX4-506] to provide an > OSGI bundle for that library. > Please have a look into > [Nabble|http://old.nabble.com/Proposal-for-a-new-camel-bean-validation-component-based-on-jsr-303-tp27950969p27950969.html] > for details. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira