This discussion is archived
1 Reply Latest reply: Jan 1, 2009 9:41 AM by 843793 RSS

generating base classes

843793 Newbie
Currently Being Moderated
I've seen it hinted that generating the base class of an annotated class is possible--which insinuates there are multiple passes where the initial "extend FooGenerated" would fail with a class not found, then the processor sees Foo, generates "FooGenerated", and then the compiler retries compiling Foo with the now-present FooGenerated.

I can't get this to work--I'm not trying base classes, just a "Blah" dummy class.

Here is my annotation processor:

And an example class with my annotation that references my dummy "Blah" class:

But compiling this (with "ant jar compile-example") gives: shows up in "bin/example" (the output path of the ant javac task), but no Blah.class, nor any other .class files, which is kind of weird.

The build.xml is pretty simple, I think:

Is there something I'm missing to get this "users classes depending on generated classes" behavior to work?

  • 1. Re: generating base classes
    843793 Newbie
    Currently Being Moderated
    Nevermind, this works if "FooGenerated" is in the same package as "Foo". I was trying to start with small steps and so started with the root package. I was too focused on the annotation processing details to overlook the obvious "this wouldn't even work in regular Java".