compiler returns error on plugging processor

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • emekadavid
    New Member
    • Mar 2007
    • 46

    compiler returns error on plugging processor

    this is my code logic: I have a JSR 199 (JavaCompiler) that plugs in a processor (processor extends AbstractProcess or), the processor supports the annotation I want to reflect upon, @Worker and supports release 6 of J2SE. Am using NetBeans. The @Worker annotation is implemented a class, Staff, and the @Worker has @Target of TYPE.
    Now the problem: when I compile the JSR 199 code, it returns:

    E:\Documents and Settings\isaak\ My Documents\NetBe ansProjects\art icles\src\art\S taff.java:14: cannot find symbol
    symbol: class Worker
    @Worker(value=@ Name(firstName= "Jules", lastName="Verno n"),
    E:\Documents and Settings\isaak\ My Documents\NetBe ansProjects\art icles\src\art\S taff.java:14: cannot find symbol
    symbol: class Worker
    @Worker(value=@ Name(firstName= "Jules", lastName="Verno n"),
    1 error

    now this is my @Worker declaration:
    @Target(Element Type.TYPE)
    @Retention(Rete ntionPolicy.CLA SS)
    public @interface Worker {
    Name value();
    enum SeasonEmployed{ Spring, Winter, Autumn, Summer}
    SeasonEmployed season();
    String[] references() default "unavailabl e";
    String townResidence() ;
    }

    and the @Name declaration that it nests:
    @Target(Element Type.ANNOTATION _TYPE)
    @Retention(Rete ntionPolicy.CLA SS)
    public @interface Name {
    String firstName();
    String lastName();
    }

    and it's implemented by a class, Staff:
    @Worker(value=@ Name(firstName= "Jules", lastName="Verno n"),
    season=Worker.S easonEmployed.S ummer,
    references={"Si te-Mgr", "Works-Mgr"},
    townResidence=" London")
    public class Staff {

    private boolean employeeType;

    public boolean getEType(){
    return employeeType;
    }

    public Staff(boolean type){
    this.employeeTy pe = type;
    }
    }

    can anyone tell me why the compiler is giving that error. The processor's process method is very simple does nothing but call:
    for(TypeElement te : annotations)... .
    print out count of annotations in the element, staff.
    That's all.
    thanx
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    Where are you with this one, have you made any improvements?

    You might want to walk away from it and try again, just stuff I do to clear my thoughts.

    Also, please tell us in detail what the project is all about, without the code... perhaps we can tell you another way of achieving it.

    Sorry for your troubles!

    Dököll

    Comment

    Working...