Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Annotation Processor Manager Extension Point(Annotation Processor Manager Extension Point usability)
Annotation Processor Manager Extension Point [message #785169] Sat, 28 January 2012 15:55 Go to next message
Alexandre Dupriez is currently offline Alexandre DupriezFriend
Messages: 3
Registered: January 2012
Location: Paris
Junior Member
Dear all,

Please note first that I post on JDT-core forum though JDT-APT might be a better place regarding the subject, but I think it is worth having a try here as most of the classes involved in my questions are defined in org.eclipse.jdt.core bundle and used in the
org.eclipse.jdt.internal.compiler.Compiler
class.

There is one extension point defined in the JDT Plug-in Developer API which is
org.eclipse.jdt.core.annotationProcessorManager

From the documentation, this extension point "gives the JDT access to a Java 6 annotation processor manager on platforms where that is available. At most one Java 6 annotation processor manager extension can be registered."

For some reasons, I needed to keep extra control over a Java 6 annotation processor (e.g. to do some preprocessing work which cannot be done in the annotation processor itself since the annotation processor's environment holds too few information to do the job) and implemented my own annotation processor manager. But the point is, that it is always the manager

org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager

which gets registered, and, since At most one Java 6 annotation processor manager extension can be registered, mine had never a chance to be called by the compiler (actually, the registration is fine, but then the framework chooses the first Annotation Processor Manager it finds, which is the former IdeAnnotationProcessorManager).

Hence my question: how can a custom annotation processor manager be used instead of the framework's one?

Thanks in advance for any help,
Best regards,
A.
Re: Annotation Processor Manager Extension Point [message #786334 is a reply to message #785169] Mon, 30 January 2012 09:33 Go to previous messageGo to next message
Satyam Kandula is currently offline Satyam KandulaFriend
Messages: 444
Registered: July 2009
Senior Member
Ideally one is expected to use the JDT-APT to write any annotation processor. As JDT-Core doesn't depend on JDT-APT, this extension point was created so that it can callback APT during compilation. AS of now, only one annotation processor manager is being called. If you really need another manager, please file an enhancement request.
Re: Annotation Processor Manager Extension Point [message #786767 is a reply to message #786334] Mon, 30 January 2012 19:57 Go to previous messageGo to next message
Alexandre Dupriez is currently offline Alexandre DupriezFriend
Messages: 3
Registered: January 2012
Location: Paris
Junior Member
Thanks for the clear and quick reply.

Indeed, I needed to take extra control over an existing annotation processor and found the annotation processor manager as the right entry point to do so.

Maybe it is worth to fill the gap which prevented me to use another annotation processor manager besides the IdeAnnotationProcessorManager. Should you judge so, I would be pleased to help provide a patch along with unit tests (including plugin unit tests).

Best regards.
A.
Re: Annotation Processor Manager Extension Point [message #787022 is a reply to message #786767] Tue, 31 January 2012 04:00 Go to previous messageGo to next message
Satyam Kandula is currently offline Satyam KandulaFriend
Messages: 444
Registered: July 2009
Senior Member
Patches are always welcome Smile. BTW, Does CompilationParticipant help your purpose?
Re: Annotation Processor Manager Extension Point [message #787606 is a reply to message #787022] Tue, 31 January 2012 19:33 Go to previous messageGo to next message
Alexandre Dupriez is currently offline Alexandre DupriezFriend
Messages: 3
Registered: January 2012
Location: Paris
Junior Member
Great to hear that.

As far as I have seen, a CompilationParticipant was not suitable for what I wanted, since I needed a full round environment as provided to a Java 6 annotation processor (using mirror API), and did not find this kind of context in a compilation participant.

Maybe I misled myself?

About the patch, it could be great if I can discuss about it, can I use the mailing list jdt-core-dev@eclipse.org for this purpose ?

Thanks and best regards;
A.
Re: Annotation Processor Manager Extension Point [message #787889 is a reply to message #787606] Wed, 01 February 2012 04:41 Go to previous message
Deepak Azad is currently offline Deepak AzadFriend
Messages: 543
Registered: July 2009
Senior Member
> About the patch, it could be great if I can discuss about it, can I use
> the mailing list mailto:jdt-core-dev@eclipse.org for this purpose ?

The right place to discuss a patch is bugzilla :-) Please open a bug
against JDT - https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT
and attach your patch there.

--
Deepak Azad
http://wiki.eclipse.org/JDT/FAQ
Previous Topic:Disabling action/commands from JDT/ thirdparty plugins
Next Topic:Importing JDT Package
Goto Forum:
  


Current Time: Fri Apr 19 23:15:25 GMT 2024

Powered by FUDForum. Page generated in 0.03285 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top