[ 
https://issues.apache.org/jira/browse/BVAL-184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17246199#comment-17246199
 ] 

Gerhard Petracek edited comment on BVAL-184 at 12/9/20, 12:57 AM:
------------------------------------------------------------------

[~romain.manni-bucau]
just drop the spi config[1][2] (or its content) and run the tests provided by 
https://github.com/os890/cdi-bval-proxy-addon

to make it easier for you i also pushed a version with the latest bval-release 
to the branch
https://github.com/os890/cdi-bval-proxy-addon/tree/no_proxy_support

it only works for fields in case of the real instance (otherwise you validate 
the proxy instance), that's the whole point of the InstanceResolver spi (to get 
the real instance *if* the input is a proxy instance).

i guess you have org.apache.bval.jsr.util.Proxies in mind, but that's not 
enough (only to build the BeanDescriptor).

[1] 
https://github.com/os890/cdi-bval-proxy-addon/blob/master/owb/src/main/resources/META-INF/services/org.apache.bval.jsr.resolver.InstanceResolver
[2] 
https://github.com/os890/cdi-bval-proxy-addon/blob/master/weld/src/main/resources/META-INF/services/org.apache.bval.jsr.resolver.InstanceResolver



was (Author: gpetracek):
[~romain.manni-bucau]
just drop the spi config[1][2] (or its content) and run the tests provided by 
https://github.com/os890/cdi-bval-proxy-addon

to make it easier for you i also pushed a version with the latest bval-release 
to
https://github.com/os890/cdi-bval-proxy-addon/tree/no_proxy_support

it only works for fields in case of the real instance (otherwise you validate 
the proxy instance), that's the whole point of the InstanceResolver spi (to get 
the real instance *if* the input is a proxy instance).

i guess you have org.apache.bval.jsr.util.Proxies in mind, but that's not 
enough (only to build the BeanDescriptor).

[1] 
https://github.com/os890/cdi-bval-proxy-addon/blob/master/owb/src/main/resources/META-INF/services/org.apache.bval.jsr.resolver.InstanceResolver
[2] 
https://github.com/os890/cdi-bval-proxy-addon/blob/master/weld/src/main/resources/META-INF/services/org.apache.bval.jsr.resolver.InstanceResolver


> Support for proxied instances
> -----------------------------
>
>                 Key: BVAL-184
>                 URL: https://issues.apache.org/jira/browse/BVAL-184
>             Project: BVal
>          Issue Type: New Feature
>            Reporter: Gerhard Petracek
>            Assignee: Gerhard Petracek
>            Priority: Major
>
> currently org.apache.bval.jsr.util.Proxies just detects the real class, but 
> that means only getters can get annotated.
> with a spi like
> {code}
> public interface InstanceResolver extends Comparable<InstanceResolver> {
>     <T> T resolveInstance(T instance);
>     //...
> }
> {code}
> it would be possible to create resolvers for external libs (like owb, weld, 
> ...)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to