How to declare a warning on field with AspectJ
- by Ralph
I want to declare a warning on all fields Annotated with @org.jboss.weld.context.ejb.Ejb in AspectJ.
But I do not find a way how to select that field.
I guess the aspect should be something like that:
public aspect WrongEjbAnnotationWarningAspect {
declare warning :
within(com.queomedia..*) &&
??? (@org.jboss.weld.context.ejb.Ejb)
: "WrongEjbAnnotationErrorAspect: use javax.ejb.EJB instead of weld Ejb!";
}
Or is it impossible to declare warnings on fields at all?