[
https://issues.apache.org/jira/browse/CXF-5309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13821178#comment-13821178
]
Sergey Beryozkin edited comment on CXF-5309 at 11/13/13 10:51 AM:
------------------------------------------------------------------
Hi Andriy, thanks for the last 2 patches, I'll work on them shorty.
Regarding the parameter name handler injection, should we also support a setter
? The constructor injection is fine (lets keep this single new constructor),
but we'd need to have more constructors added to cover the cases where we have
multiple providers available, given that the provider has additional
constructors for supporting non-default factory initializations and doing the
constructor injection with more than 1 arg when it might be needed is not easy
from Spring :-).
What about additionally supporting a setter and then, for example,
{code:java}
private< T > Set<ConstraintViolation< T > > doValidateBean(final T bean) {
return getValidator().validate(bean);
}
private ExecutableValidator getExecutableValidator() {
return getValidator().forExecutables();
}
private Validator getValidator() {
if (paramHandler != null) {
return
factory.usingContext().parameterNameProvider(paramHandler).getValidator();
} else {
return factory.getValidator();
}
}
{code}
Will it work for you ?
Thanks, Sergey
was (Author: sergey_beryozkin):
Hi Andriy, thanks for the last 2 patches, I'll work on them shorty.
Regarding the parameter name handler injection, should we also support a setter
? The constructor injection is fine (lets keep this single new constructor),
but we'd need to have more constructors added to cover the cases where we have
multiple providers available, given that the provider has additional
constructors for supporting non-default factory initializations and doing the
constructor injection with more than 1 arg when it might be needed is not easy
from Spring :-).
What about additionally supporting a setter and then, for example,
{code:java}
private< T > Set<ConstraintViolation< T > > doValidateBean(final T bean) {
return getValidator().validate(bean);
}
private ExecutableValidator getExecutableValidator() {
return getValidator().forExecutables();
}
private Validator getValidator() {
if (paramHandler != null) {
return
factory.usingContext().parameterNameProvider(paramHandler).getVaidator();
} else {
return factory.getValidator();
}
}
{code}
Will it work for you ?
Thanks, Sergey
> Support Bean Validation API for JAX-RS
> --------------------------------------
>
> Key: CXF-5309
> URL: https://issues.apache.org/jira/browse/CXF-5309
> Project: CXF
> Issue Type: Sub-task
> Components: JAX-RS, JAX-WS Runtime
> Reporter: Sergey Beryozkin
> Attachments: patch-validation-exception-mapper.txt,
> patch-validation-paramnameprovider.txt, patch-validation-poc.txt,
> patch-validation-spring-tests.txt, patch-validation-tests.txt
>
>
--
This message was sent by Atlassian JIRA
(v6.1#6144)