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

Justin Edelson commented on SLING-5739:
---------------------------------------

To be clear, this isn't really about switching the resource. It is about 
switching the adaptable. Once you think in those terms, it should become clear 
that `@ViaResource` is a special case and not a general approach. IMHO, the 
only options are:

* `@Via(value = "jcr:content", type = ChildResource.class)`
* `@Via(value = "jcr:content", type = "child-resource")`

I'm open to supporting an annotation processor thing for `@Via` similar to what 
we have for `@Inject` but IMHO this must be optional and we need to try to 
figure out some way to avoid the pain that the injector-specific annotations 
have caused.

> [Sling Models] Allow for extensible @Via providers
> --------------------------------------------------
>
>                 Key: SLING-5739
>                 URL: https://issues.apache.org/jira/browse/SLING-5739
>             Project: Sling
>          Issue Type: New Feature
>          Components: Extensions
>            Reporter: Justin Edelson
>
> Currently, @Via support in Sling Models is limited to JavaBean properties. It 
> would be useful to be able to extend this and allow for downstream projects 
> to add new @Via providers.
> Proposing to support this by extending the @Via annotation
> {code}
> @Via(value = "jcr:content", type = ChildResource.class)
> {code}
> The default type is BeanProperty (the current behavior).
> New providers can be added by implementing a ViaProvider SPI and provide a 
> marker class for use in the annotation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to