[jbosstools-dev] Seam Scanner for class files

Max Rydahl Andersen max.andersen at redhat.com
Sat Jul 14 02:19:43 EDT 2007


Eclipse APT ?!
How did you work around the issues of having the user register the APT 
processing etc ? The need for that was the main reason I moved to the 
"lower" level API which did not require special setup.

/max

> I used APT in the jboss aop code. If you want to look at it I can direct 
> you to the svn location and package.
> 
> - Rob Stryker
> 
> Max Rydahl Andersen wrote:
>>
>>> JDT does not include annotations into java model.
>>
>> true, but that is why you use something like APT does and reads the 
>> annotations. e.g. use the compilation participant and parse the source
>> and you can visit the nodes. I did that in my initial prototype, 
>> unfortunatly i don't have the code on my laptop. I'll post it when I 
>> find it or get back to my desktop.
>>
>> I don't think loading the classes is a sustainable usage since 
>> classfiles will not be available when incomplete files and is it not 
>> inefficient and impossible to clean up.
>>
>> For .jar's it's usable to look into ClassFileREader thouhgh.
>>
>> /max
>>
>>
>>> By now, java.lang.Class is used to load annotations.
>>> To obtain Class objects, class loader is created for
>>> user project. That way seems to be quite fast and reliable.
>>>
>>> I have found that jdt uses
>>> org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader
>>> to load java model, and probably it provides all required information
>>> about annotations, but that needs some more studies.
>>>
>>> I  think that for the time being we may use java.lang.Class-based
>>> implementation to attend other urgent issues, and replace it
>>> with ClassFileReader-based implementation later if time allows.
>>>
>>> Slava Kabanovich
>>>
>>> _______________________________________________
>>> jbosstools-dev mailing list
>>> jbosstools-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/jbosstools-dev
>>
>> _______________________________________________
>> jbosstools-dev mailing list
>> jbosstools-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/jbosstools-dev




More information about the jbosstools-dev mailing list