Alex Beggs
07/07/2021, 5:11 PMgetAnnotation
in a separate repo. I saw that the implementation is pending for KSP and would like to know if I could help contribute there. If so I have a couple of questions. Which elements should we apply the functions to? I was thinking the KSAnnotated seems to make sense. ie KSAnnotated#getAnnotation
I had also thought of taking a different approach and leveraging the Method#getAnnotation
method by just getting a handle to the Method
itself from the KSAnnotated
, but I hadn’t done any further research into that yet. What approaches were you thinking about taking? And does my current implementation in my repo seem reasonable or is there a better approach?
I had thought about just creating a PR, but I would rather get some feedback first before I invest the time.
Thanksyigit
07/07/2021, 6:33 PMAlex Beggs
07/07/2021, 11:51 PMyigit
07/08/2021, 3:25 PMAlex Beggs
07/08/2021, 3:26 PMAlex Beggs
07/08/2021, 3:27 PMTing-Yuan Huang
07/08/2021, 7:12 PMAlex Beggs
07/08/2021, 7:14 PMKSAnnotated
class as an extension function is fine?Alex Beggs
07/08/2021, 7:14 PMTing-Yuan Huang
07/08/2021, 7:26 PMKSAnnotated
sounds natural to me. May I know what places else you are thinking about?Alex Beggs
07/08/2021, 7:28 PM<https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/AnnotatedElement.html>
Alex Beggs
07/08/2021, 7:28 PMTing-Yuan Huang
07/08/2021, 7:31 PMgetDeclaredAnnotation
family might not be needed, as in KSP annotations are not inheritable.Ting-Yuan Huang
07/08/2021, 7:32 PMJiaxiang
07/08/2021, 7:33 PMAlex Beggs
07/08/2021, 7:34 PM<https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html#getDeclaredAnnotations-->
that wouldn’t work properly?Jiaxiang
07/08/2021, 7:34 PMAlex Beggs
07/08/2021, 7:34 PMJiaxiang
07/08/2021, 7:35 PMReturns annotations that are _directly present_ on this element. This method ignores inherited annotations.
which I think matches what we do in KSP?Alex Beggs
07/08/2021, 7:35 PMAlex Beggs
07/08/2021, 7:36 PMAlex Beggs
07/08/2021, 7:37 PMJiaxiang
07/08/2021, 7:37 PMAlex Beggs
07/08/2021, 7:37 PMJiaxiang
07/08/2021, 7:37 PMAlex Beggs
07/08/2021, 7:38 PMAlex Beggs
07/08/2021, 7:38 PMAlex Beggs
07/08/2021, 7:39 PMJiaxiang
07/08/2021, 7:40 PMAlex Beggs
07/08/2021, 7:41 PMJiaxiang
07/08/2021, 7:41 PMTing-Yuan Huang
07/08/2021, 7:44 PMKSAnnotated.annotations
doesn't include inherited annotations, only declared annotations are available in KSP. And we don't need to name it declaredAnntation
because it is the only / default behavior.Alex Beggs
07/08/2021, 7:45 PMAlex Beggs
07/08/2021, 7:45 PMAlex Beggs
07/08/2021, 7:46 PMdeclared
family of methods as was stated beforeTing-Yuan Huang
07/08/2021, 7:48 PMAlex Beggs
07/27/2021, 3:34 AM