[jbosstools-dev] Seam Scanner for class files

Max Rydahl Andersen max.andersen at redhat.com
Tue Jul 10 13:23:04 EDT 2007


> 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




More information about the jbosstools-dev mailing list