1 27 package ch.ethz.prose.filter; 28 29 import java.util.*; 31 import java.io.*; 32 import ch.ethz.jvmai.JoinPointKinds; 33 34 40 public 41 class Within { 42 43 public static PointCutter type(String regexp) 44 { 45 PointCutter t = new ExecutionsInClassFilter(regexp,ExecutionsInClassFilter.MATCH_CLASS_NAME_OPMODE); 46 t.setToString("Within.type(" + regexp + ")"); 47 return t; 48 } 49 50 public static PointCutter packageTypes(String regexp) 51 { 52 PointCutter t = new ExecutionsInClassFilter(regexp,ExecutionsInClassFilter.MATCH_PACKAGE_NAME_OPMODE); 53 t.setToString("Within.packages(" + regexp + ")"); 54 return t; 55 } 56 57 public static PointCutter type(Class cls) 58 { 59 PointCutter t = new ExecutionsInSubclassFilter(cls, ExecutionsInSubclassFilter.NO_INHERITANCE); 60 t.setToString("Within.type(" + cls.getName() + ")"); 61 return t; 62 } 63 64 public static PointCutter type(int modifier) 65 { 66 PointCutter t = new ExecutionsAclFilter(modifier, ExecutionsAclFilter.FILTER_CLASS_MODIFIERS); 67 t.setToString("Within.type(" + modifier + ")"); 68 return t; 69 } 70 71 public static PointCutter subType(Class cls) 72 { 73 PointCutter t = new ExecutionsInSubclassFilter(cls, ExecutionsInSubclassFilter.SUBCLASS_INHERITANCE); 74 t.setToString("Within.subType(" + cls.getName() + ")"); 75 return t; 76 } 77 78 79 public static PointCutter superType(Class cls) 80 { 81 PointCutter t = new ExecutionsInSubclassFilter(cls, ExecutionsInSubclassFilter.SUPERCLASS_INHERITANCE); 82 t.setToString("Within.superType(" + cls.getName() + ")"); 83 return t; 84 } 85 86 87 public static PointCutter method(String regexp) 88 { 89 PointCutter t = new ExecutionsInMethodFilter(regexp); 90 t.setToString("Within.method(" + regexp + ")"); 91 return t; 92 } 93 94 95 public static PointCutter method(int modifier) 96 { 97 PointCutter t = new ExecutionsAclFilter(modifier, ExecutionsAclFilter.FILTER_METHOD_MODIFIERS); 98 t.setToString("Within.method(" + modifier + ")"); 99 return t; 100 } 101 102 public static PointCutter userCode() 103 { 104 PointCutter t = new NegatingPointCutter(new ExecutionsInSystemClass()); 105 t.setToString("Within.userCode()"); 106 return t; 107 } 108 109 public static PointCutter systemCode() 110 { 111 PointCutter t = new ExecutionsInSystemClass(); 112 t.setToString("Within.systemCode()"); 113 return t; 114 } 115 116 } 117 118 119
| Popular Tags
|