1 7 8 9 import ch.ethz.prose.DefaultAspect; 11 import ch.ethz.prose.crosscut.Crosscut; 12 import ch.ethz.prose.crosscut.MethodCut; 13 import ch.ethz.prose.crosscut.REST; 14 import ch.ethz.prose.crosscut.ANY; 15 import ch.ethz.prose.filter.Executions; 16 import ch.ethz.prose.filter.Within; 17 import ch.ethz.prose.filter.PointCutter; 18 import ch.ethz.prose.crosscut.MissingInformationException; 19 20 26 public 27 class ExampleAspect extends DefaultAspect 28 { 29 30 public Crosscut c1 = new MethodCut() 31 { 32 public void METHOD_ARGS(ANY x, String arg1,REST y) 34 { 35 System.err.println(" ->advice: before "+ x.getObject() + ".'bar*'("+ arg1 +",..) called"); 36 } 37 38 protected PointCutter pointCutter() 40 {return ( (Executions.before()) . AND 41 (Within.method("bar.*")) . AND 42 (Within.type("Foo")) );} 43 }; 44 45 } 46 47 48 | Popular Tags |