bval-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerhard Petracek (Jira)" <j...@apache.org>
Subject [jira] [Comment Edited] (BVAL-184) Support for proxied instances
Date Wed, 09 Dec 2020 00:16:00 GMT

    [ 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:15 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

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).

[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

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).

[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)

Mime
View raw message