[
https://issues.apache.org/jira/browse/SLING-3949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14153093#comment-14153093
]
Justin Edelson commented on SLING-3949:
---------------------------------------
Thanks for the updated example. Although it might be a subtle distinction, IMHO
a BeanValue injector makes more semantic sense. The purpose of the @Via
annotation is to locate the adaptable. While it is an interesting side effect
to adding the self injector that @Via can work for injecting arbitrary bean
properties, I think in these cases you would still consider the Page to be the
adaptable. If you would be willing to donate your Bean Value injector, that
would be most welcome.
> Sling Models: Add via support to Self annotation
> ------------------------------------------------
>
> Key: SLING-3949
> URL: https://issues.apache.org/jira/browse/SLING-3949
> Project: Sling
> Issue Type: Improvement
> Reporter: Jason E Bailey
> Priority: Minor
> Labels: models
>
> Allows the object that is to be applied or adapted to come from a property of
> the given adaptable.
> example:
> {code}
> @Model(adaptables = SlingHttpServletRequest.class)
> public class Foo {
> @Self(via = "resourceResolver")
> TagManager tagManager;
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)