[jira] [Commented] (SLING-3499) Support custom annotations with Sling Models

2014-07-11 Thread Justin Edelson (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14058534#comment-14058534
 ] 

Justin Edelson commented on SLING-3499:
---

[~kwin] Sorry for the delay; I have pushed the documentation changes. I did 
remove the bit about performance improvements as, AFAIK, we don't have any 
tests to show what the performance difference is. That would be interesting to 
add at a later point.

 Support custom annotations with Sling Models
 

 Key: SLING-3499
 URL: https://issues.apache.org/jira/browse/SLING-3499
 Project: Sling
  Issue Type: New Feature
  Components: Extensions
Affects Versions: Sling Models API 1.0.0, Sling Models Implementation 1.0.2
Reporter: Konrad Windszus
Assignee: Justin Edelson
 Fix For: Sling Models Implementation 1.0.6, Sling Models API 1.0.2

 Attachments: SLING-3499-Documentation-v1.patch, 
 SLING-3499-Documentation-v2.patch


 To support custom annotations the API needs to be extended. 
 The reasons for custom annotations are listed in 
 http://www.mail-archive.com/dev%40sling.apache.org/msg27918.html. Also it is 
 much more comfortable for developers, since they can use code completion in 
 the IDE to see which options are available for each injector-specific 
 annotation, apart from that it is less code to write (instead of multiple 
 annotations on one field/method I would only have to write one annotation 
 with some attributes).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3499) Support custom annotations with Sling Models

2014-07-11 Thread Konrad Windszus (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14058539#comment-14058539
 ] 

Konrad Windszus commented on SLING-3499:


[~justinedelson] Thanks a lot. Indeed I have not measured the performance 
impact. Also that would matter a lot on which injector is taken in the end (if 
the previous ones make an expensive lookup and all fail it is obviously 
bigger). But of course I am fine with removing that statement for now.

 Support custom annotations with Sling Models
 

 Key: SLING-3499
 URL: https://issues.apache.org/jira/browse/SLING-3499
 Project: Sling
  Issue Type: New Feature
  Components: Extensions
Affects Versions: Sling Models API 1.0.0, Sling Models Implementation 1.0.2
Reporter: Konrad Windszus
Assignee: Justin Edelson
 Fix For: Sling Models Implementation 1.0.6, Sling Models API 1.0.2

 Attachments: SLING-3499-Documentation-v1.patch, 
 SLING-3499-Documentation-v2.patch


 To support custom annotations the API needs to be extended. 
 The reasons for custom annotations are listed in 
 http://www.mail-archive.com/dev%40sling.apache.org/msg27918.html. Also it is 
 much more comfortable for developers, since they can use code completion in 
 the IDE to see which options are available for each injector-specific 
 annotation, apart from that it is less code to write (instead of multiple 
 annotations on one field/method I would only have to write one annotation 
 with some attributes).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3499) Support custom annotations with Sling Models

2014-07-07 Thread Konrad Windszus (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14053565#comment-14053565
 ] 

Konrad Windszus commented on SLING-3499:


Hi [~justinedelson], now that 1.0.6 is released, would it be possible to merge 
my documentation changes?
Thanks a lot!

 Support custom annotations with Sling Models
 

 Key: SLING-3499
 URL: https://issues.apache.org/jira/browse/SLING-3499
 Project: Sling
  Issue Type: New Feature
  Components: Extensions
Affects Versions: Sling Models API 1.0.0, Sling Models Implementation 1.0.2
Reporter: Konrad Windszus
Assignee: Justin Edelson
 Fix For: Sling Models Implementation 1.0.6, Sling Models API 1.0.2

 Attachments: SLING-3499-Documentation-v1.patch, 
 SLING-3499-Documentation-v2.patch


 To support custom annotations the API needs to be extended. 
 The reasons for custom annotations are listed in 
 http://www.mail-archive.com/dev%40sling.apache.org/msg27918.html. Also it is 
 much more comfortable for developers, since they can use code completion in 
 the IDE to see which options are available for each injector-specific 
 annotation, apart from that it is less code to write (instead of multiple 
 annotations on one field/method I would only have to write one annotation 
 with some attributes).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3499) Support custom annotations with Sling Models

2014-06-24 Thread Konrad Windszus (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14042022#comment-14042022
 ] 

Konrad Windszus commented on SLING-3499:


With the changes from SLING-3683 the attached documentation patch needs to be 
adjusted (in the section Custom Annotations). [~justinedelson] Can you take 
care of that?

 Support custom annotations with Sling Models
 

 Key: SLING-3499
 URL: https://issues.apache.org/jira/browse/SLING-3499
 Project: Sling
  Issue Type: New Feature
  Components: Extensions
Affects Versions: Sling Models API 1.0.0, Sling Models Implementation 1.0.2
Reporter: Konrad Windszus
Assignee: Justin Edelson
 Fix For: Sling Models Implementation 1.0.6, Sling Models API 1.0.2

 Attachments: SLING-3499-Documentation-v1.patch, 
 SLING-3499-Documentation-v2.patch


 To support custom annotations the API needs to be extended. 
 The reasons for custom annotations are listed in 
 http://www.mail-archive.com/dev%40sling.apache.org/msg27918.html. Also it is 
 much more comfortable for developers, since they can use code completion in 
 the IDE to see which options are available for each injector-specific 
 annotation, apart from that it is less code to write (instead of multiple 
 annotations on one field/method I would only have to write one annotation 
 with some attributes).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3499) Support custom annotations with Sling Models

2014-06-24 Thread Justin Edelson (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14042530#comment-14042530
 ] 

Justin Edelson commented on SLING-3499:
---

Yes, I'll take care of the documentation updates.

 Support custom annotations with Sling Models
 

 Key: SLING-3499
 URL: https://issues.apache.org/jira/browse/SLING-3499
 Project: Sling
  Issue Type: New Feature
  Components: Extensions
Affects Versions: Sling Models API 1.0.0, Sling Models Implementation 1.0.2
Reporter: Konrad Windszus
Assignee: Justin Edelson
 Fix For: Sling Models Implementation 1.0.6, Sling Models API 1.0.2

 Attachments: SLING-3499-Documentation-v1.patch, 
 SLING-3499-Documentation-v2.patch


 To support custom annotations the API needs to be extended. 
 The reasons for custom annotations are listed in 
 http://www.mail-archive.com/dev%40sling.apache.org/msg27918.html. Also it is 
 much more comfortable for developers, since they can use code completion in 
 the IDE to see which options are available for each injector-specific 
 annotation, apart from that it is less code to write (instead of multiple 
 annotations on one field/method I would only have to write one annotation 
 with some attributes).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3499) Support custom annotations with Sling Models

2014-06-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14032189#comment-14032189
 ] 

ASF GitHub Bot commented on SLING-3499:
---

Github user kwin closed the pull request at:

https://github.com/apache/sling/pull/13


 Support custom annotations with Sling Models
 

 Key: SLING-3499
 URL: https://issues.apache.org/jira/browse/SLING-3499
 Project: Sling
  Issue Type: New Feature
  Components: Extensions
Affects Versions: Sling Models API 1.0.0, Sling Models Implementation 1.0.2
Reporter: Konrad Windszus
Assignee: Justin Edelson
 Fix For: Sling Models Implementation 1.0.6

 Attachments: SLING-3499-Documentation-v1.patch, 
 SLING-3499-Documentation-v2.patch


 To support custom annotations the API needs to be extended. 
 The reasons for custom annotations are listed in 
 http://www.mail-archive.com/dev%40sling.apache.org/msg27918.html. Also it is 
 much more comfortable for developers, since they can use code completion in 
 the IDE to see which options are available for each injector-specific 
 annotation, apart from that it is less code to write (instead of multiple 
 annotations on one field/method I would only have to write one annotation 
 with some attributes).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3499) Support custom annotations with Sling Models

2014-06-05 Thread Konrad Windszus (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14018580#comment-14018580
 ] 

Konrad Windszus commented on SLING-3499:


Hi [~justinedelson], thanks for committing that. I attached a patch which adds 
some documentation around the injector-specific annotations.

 Support custom annotations with Sling Models
 

 Key: SLING-3499
 URL: https://issues.apache.org/jira/browse/SLING-3499
 Project: Sling
  Issue Type: New Feature
  Components: Extensions
Affects Versions: Sling Models API 1.0.0, Sling Models Implementation 1.0.2
Reporter: Konrad Windszus
Assignee: Justin Edelson
 Fix For: Sling Models Implementation 1.0.6

 Attachments: SLING-3499-Documentation-v1.patch


 To support custom annotations the API needs to be extended. 
 The reasons for custom annotations are listed in 
 http://www.mail-archive.com/dev%40sling.apache.org/msg27918.html. Also it is 
 much more comfortable for developers, since they can use code completion in 
 the IDE to see which options are available for each injector-specific 
 annotation, apart from that it is less code to write (instead of multiple 
 annotations on one field/method I would only have to write one annotation 
 with some attributes).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3499) Support custom annotations with Sling Models

2014-06-05 Thread Konrad Windszus (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14018585#comment-14018585
 ] 

Konrad Windszus commented on SLING-3499:


Updated patch to also include the table of contents (since the page is now 
pretty long).

 Support custom annotations with Sling Models
 

 Key: SLING-3499
 URL: https://issues.apache.org/jira/browse/SLING-3499
 Project: Sling
  Issue Type: New Feature
  Components: Extensions
Affects Versions: Sling Models API 1.0.0, Sling Models Implementation 1.0.2
Reporter: Konrad Windszus
Assignee: Justin Edelson
 Fix For: Sling Models Implementation 1.0.6

 Attachments: SLING-3499-Documentation-v1.patch, 
 SLING-3499-Documentation-v2.patch


 To support custom annotations the API needs to be extended. 
 The reasons for custom annotations are listed in 
 http://www.mail-archive.com/dev%40sling.apache.org/msg27918.html. Also it is 
 much more comfortable for developers, since they can use code completion in 
 the IDE to see which options are available for each injector-specific 
 annotation, apart from that it is less code to write (instead of multiple 
 annotations on one field/method I would only have to write one annotation 
 with some attributes).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3499) Support custom annotations with Sling Models

2014-06-04 Thread Konrad Windszus (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14017759#comment-14017759
 ] 

Konrad Windszus commented on SLING-3499:


Hi [~justinedelson], any progress on this? Do you need more information from me?

 Support custom annotations with Sling Models
 

 Key: SLING-3499
 URL: https://issues.apache.org/jira/browse/SLING-3499
 Project: Sling
  Issue Type: New Feature
  Components: Extensions
Affects Versions: Sling Models API 1.0.0, Sling Models Implementation 1.0.2
Reporter: Konrad Windszus

 To support custom annotations the API needs to be extended. 
 The reasons for custom annotations are listed in 
 http://www.mail-archive.com/dev%40sling.apache.org/msg27918.html. Also it is 
 much more comfortable for developers, since they can use code completion in 
 the IDE to see which options are available for each injector-specific 
 annotation, apart from that it is less code to write (instead of multiple 
 annotations on one field/method I would only have to write one annotation 
 with some attributes).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3499) Support custom annotations with Sling Models

2014-06-04 Thread Justin Edelson (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14017851#comment-14017851
 ] 

Justin Edelson commented on SLING-3499:
---

[~kwin] the only thing left to be done is that I want to write a test or two 
for the default capability. I should be able to do that in the next week. Just 
been busy.

 Support custom annotations with Sling Models
 

 Key: SLING-3499
 URL: https://issues.apache.org/jira/browse/SLING-3499
 Project: Sling
  Issue Type: New Feature
  Components: Extensions
Affects Versions: Sling Models API 1.0.0, Sling Models Implementation 1.0.2
Reporter: Konrad Windszus

 To support custom annotations the API needs to be extended. 
 The reasons for custom annotations are listed in 
 http://www.mail-archive.com/dev%40sling.apache.org/msg27918.html. Also it is 
 much more comfortable for developers, since they can use code completion in 
 the IDE to see which options are available for each injector-specific 
 annotation, apart from that it is less code to write (instead of multiple 
 annotations on one field/method I would only have to write one annotation 
 with some attributes).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3499) Support custom annotations with Sling Models

2014-06-04 Thread Justin Edelson (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14018084#comment-14018084
 ] 

Justin Edelson commented on SLING-3499:
---

OK. I moved that along. Commited in r1600469.

[~kwin] any chance you feel like submitting a patch for the documentation?

 Support custom annotations with Sling Models
 

 Key: SLING-3499
 URL: https://issues.apache.org/jira/browse/SLING-3499
 Project: Sling
  Issue Type: New Feature
  Components: Extensions
Affects Versions: Sling Models API 1.0.0, Sling Models Implementation 1.0.2
Reporter: Konrad Windszus

 To support custom annotations the API needs to be extended. 
 The reasons for custom annotations are listed in 
 http://www.mail-archive.com/dev%40sling.apache.org/msg27918.html. Also it is 
 much more comfortable for developers, since they can use code completion in 
 the IDE to see which options are available for each injector-specific 
 annotation, apart from that it is less code to write (instead of multiple 
 annotations on one field/method I would only have to write one annotation 
 with some attributes).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3499) Support custom annotations with Sling Models

2014-05-20 Thread Konrad Windszus (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14003052#comment-14003052
 ] 

Konrad Windszus commented on SLING-3499:


Hi [~justinedelson], my intent was to make it possible to define defaults also 
within the custom annotations. I didn't leverage that for my custom 
annotations, because it is just a lot of effort due to type limitations on 
annotation attributes 
(http://stackoverflow.com/questions/1458535/which-types-can-be-used-for-java-annotation-members).
 Therefore I decided to still leverage the default annotation for that. 
Otherwise a lot of boilerplate code would be necessary, which wouldn't add too 
much value IMHO.
I still would leave it within the annotation processor, because I can image 
that there might be use cases for that (in other annotations).

 Support custom annotations with Sling Models
 

 Key: SLING-3499
 URL: https://issues.apache.org/jira/browse/SLING-3499
 Project: Sling
  Issue Type: New Feature
  Components: Extensions
Affects Versions: Sling Models API 1.0.0, Sling Models Implementation 1.0.2
Reporter: Konrad Windszus

 To support custom annotations the API needs to be extended. 
 The reasons for custom annotations are listed in 
 http://www.mail-archive.com/dev%40sling.apache.org/msg27918.html. Also it is 
 much more comfortable for developers, since they can use code completion in 
 the IDE to see which options are available for each injector-specific 
 annotation, apart from that it is less code to write (instead of multiple 
 annotations on one field/method I would only have to write one annotation 
 with some attributes).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3499) Support custom annotations with Sling Models

2014-05-16 Thread Konrad Windszus (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13998721#comment-13998721
 ] 

Konrad Windszus commented on SLING-3499:


Hi Justin, the patch looks fine to me, but please make sure that the changed 
handling of default values is not overwritten (SLING-3547). I definitely 
appreciate your changes. There is only one thing which should be changed which 
is the Javadoc for InjectAnnotationProcessor.isOptional(). There is some copy 
paste mistake in there. It should rather state that three values are supported 
as return values: true, means the injection can be left out, false means it is 
mandatory and null means the value from the Optional annotation is taken.

 Support custom annotations with Sling Models
 

 Key: SLING-3499
 URL: https://issues.apache.org/jira/browse/SLING-3499
 Project: Sling
  Issue Type: New Feature
  Components: Extensions
Affects Versions: Sling Models API 1.0.0, Sling Models Implementation 1.0.2
Reporter: Konrad Windszus

 To support custom annotations the API needs to be extended. 
 The reasons for custom annotations are listed in 
 http://www.mail-archive.com/dev%40sling.apache.org/msg27918.html. Also it is 
 much more comfortable for developers, since they can use code completion in 
 the IDE to see which options are available for each injector-specific 
 annotation, apart from that it is less code to write (instead of multiple 
 annotations on one field/method I would only have to write one annotation 
 with some attributes).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3499) Support custom annotations with Sling Models

2014-05-15 Thread Justin Edelson (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13997947#comment-13997947
 ] 

Justin Edelson commented on SLING-3499:
---

Hi [~kwin], sorry for the delay looking at this. I went through and did some 
refactoring. Please reivew http://codereview.appspot.com/95250047

Here's a summary of the changes:ere's a summary of the changes:
1) Moved new SPI interfaces/classes into separate package
2) Renamed Value annotation to ValueMapValue
3) Changed ModelInject to InjectAnnotation (which is somewhat repetitive, but 
since end users never use it, this seemed OK)
4) Made all the annotation processors inner classes. 
5) Reduced the use of annonymous inner classes to avoid extra object creation.
6) Moved some things around inside injectFieldOrMethod() so that 
createAnnotationProcessor was only called if the source matches.

 Support custom annotations with Sling Models
 

 Key: SLING-3499
 URL: https://issues.apache.org/jira/browse/SLING-3499
 Project: Sling
  Issue Type: New Feature
  Components: Extensions
Affects Versions: Sling Models API 1.0.0, Sling Models Implementation 1.0.2
Reporter: Konrad Windszus

 To support custom annotations the API needs to be extended. 
 The reasons for custom annotations are listed in 
 http://www.mail-archive.com/dev%40sling.apache.org/msg27918.html. Also it is 
 much more comfortable for developers, since they can use code completion in 
 the IDE to see which options are available for each injector-specific 
 annotation, apart from that it is less code to write (instead of multiple 
 annotations on one field/method I would only have to write one annotation 
 with some attributes).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3499) Support custom annotations with Sling Models

2014-04-22 Thread Konrad Windszus (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13976566#comment-13976566
 ] 

Konrad Windszus commented on SLING-3499:


The pull request listed above adds the following annotations (with the optional 
attributes listed in brackets)

- OSGiService (optional, filter) 
- ChildResource (optional, name, via)
- ScriptVariable (optional, name)
- Value (optional, name, via)
- RequestAttribute (optional, name)

Those annotations make Sling Models inject the field/method only from the 
mentioned injector. 
Also there are two interfaces added to the API bundle (ModelAnnotationProcessor 
and ModelAnnotationProcessorFactory) for adding more custom annotations in the 
future.

 Support custom annotations with Sling Models
 

 Key: SLING-3499
 URL: https://issues.apache.org/jira/browse/SLING-3499
 Project: Sling
  Issue Type: New Feature
  Components: Extensions
Affects Versions: Sling Models API 1.0.0, Sling Models Implementation 1.0.2
Reporter: Konrad Windszus

 To support custom annotations the API needs to be extended. 
 The reasons for custom annotations are listed in 
 http://www.mail-archive.com/dev%40sling.apache.org/msg27918.html. Also it is 
 much more comfortable for developers, since they can use code completion in 
 the IDE to see which options are available for each injector-specific 
 annotation, apart from that it is less code to write (instead of multiple 
 annotations on one field/method I would only have to write one annotation 
 with some attributes).



--
This message was sent by Atlassian JIRA
(v6.2#6252)