1 22 import org.jboss.aop.DeclareWarning; 23 import org.jboss.aop.DeclareError; 24 import org.jboss.aop.Aspect; 25 import org.jboss.aop.pointcut.Pointcut; 26 27 31 @Aspect 32 public class DeclareAspect 33 { 34 @DeclareWarning (expr="class($instanceof{VehicleDAO}) AND !has(public void *->save())", msg="All VehicleDAO subclasses must override the save() method.") 35 public static Pointcut warning1; 36 37 @DeclareWarning (expr="call(Driver->new(..)) AND within(*DAO)", msg="DAO classes should not access the Driver class") 38 public static Pointcut warning2; 39 40 @DeclareWarning (expr="call(* Driver->*(..)) AND withincode(* *DAO->save())", msg="DAO classes should not access the Driver class") 41 public static Pointcut warning3; 42 43 } 44 | Popular Tags |