25
25
import org .springframework .util .Assert ;
26
26
27
27
/**
28
- * Static utility methods for composing
29
- * {@link org.springframework.aop.MethodMatcher MethodMatchers}.
28
+ * Static utility methods for composing {@link MethodMatcher MethodMatchers}.
30
29
*
31
- * <p>A MethodMatcher may be evaluated statically (based on method
32
- * and target class) or need further evaluation dynamically
33
- * (based on arguments at the time of method invocation).
30
+ * <p>A MethodMatcher may be evaluated statically (based on method and target
31
+ * class) or need further evaluation dynamically (based on arguments at the
32
+ * time of method invocation).
34
33
*
35
34
* @author Rod Johnson
36
35
* @author Rob Harrop
@@ -88,7 +87,7 @@ public static MethodMatcher intersection(MethodMatcher mm1, MethodMatcher mm2) {
88
87
* asking is the subject on one or more introductions; {@code false} otherwise
89
88
* @return whether or not this method matches statically
90
89
*/
91
- public static boolean matches (MethodMatcher mm , Method method , Class targetClass , boolean hasIntroductions ) {
90
+ public static boolean matches (MethodMatcher mm , Method method , Class <?> targetClass , boolean hasIntroductions ) {
92
91
Assert .notNull (mm , "MethodMatcher must not be null" );
93
92
return ((mm instanceof IntroductionAwareMethodMatcher &&
94
93
((IntroductionAwareMethodMatcher ) mm ).matches (method , targetClass , hasIntroductions )) ||
@@ -113,29 +112,29 @@ public UnionMethodMatcher(MethodMatcher mm1, MethodMatcher mm2) {
113
112
this .mm2 = mm2 ;
114
113
}
115
114
116
- public boolean matches (Method method , Class targetClass , boolean hasIntroductions ) {
115
+ public boolean matches (Method method , Class <?> targetClass , boolean hasIntroductions ) {
117
116
return (matchesClass1 (targetClass ) && MethodMatchers .matches (this .mm1 , method , targetClass , hasIntroductions )) ||
118
117
(matchesClass2 (targetClass ) && MethodMatchers .matches (this .mm2 , method , targetClass , hasIntroductions ));
119
118
}
120
119
121
- public boolean matches (Method method , Class targetClass ) {
120
+ public boolean matches (Method method , Class <?> targetClass ) {
122
121
return (matchesClass1 (targetClass ) && this .mm1 .matches (method , targetClass )) ||
123
122
(matchesClass2 (targetClass ) && this .mm2 .matches (method , targetClass ));
124
123
}
125
124
126
- protected boolean matchesClass1 (Class targetClass ) {
125
+ protected boolean matchesClass1 (Class <?> targetClass ) {
127
126
return true ;
128
127
}
129
128
130
- protected boolean matchesClass2 (Class targetClass ) {
129
+ protected boolean matchesClass2 (Class <?> targetClass ) {
131
130
return true ;
132
131
}
133
132
134
133
public boolean isRuntime () {
135
134
return this .mm1 .isRuntime () || this .mm2 .isRuntime ();
136
135
}
137
136
138
- public boolean matches (Method method , Class targetClass , Object [] args ) {
137
+ public boolean matches (Method method , Class <?> targetClass , Object [] args ) {
139
138
return this .mm1 .matches (method , targetClass , args ) || this .mm2 .matches (method , targetClass , args );
140
139
}
141
140
@@ -179,12 +178,12 @@ public ClassFilterAwareUnionMethodMatcher(MethodMatcher mm1, ClassFilter cf1, Me
179
178
}
180
179
181
180
@ Override
182
- protected boolean matchesClass1 (Class targetClass ) {
181
+ protected boolean matchesClass1 (Class <?> targetClass ) {
183
182
return this .cf1 .matches (targetClass );
184
183
}
185
184
186
185
@ Override
187
- protected boolean matchesClass2 (Class targetClass ) {
186
+ protected boolean matchesClass2 (Class <?> targetClass ) {
188
187
return this .cf2 .matches (targetClass );
189
188
}
190
189
@@ -225,20 +224,20 @@ public IntersectionMethodMatcher(MethodMatcher mm1, MethodMatcher mm2) {
225
224
this .mm2 = mm2 ;
226
225
}
227
226
228
- public boolean matches (Method method , Class targetClass , boolean hasIntroductions ) {
227
+ public boolean matches (Method method , Class <?> targetClass , boolean hasIntroductions ) {
229
228
return MethodMatchers .matches (this .mm1 , method , targetClass , hasIntroductions ) &&
230
229
MethodMatchers .matches (this .mm2 , method , targetClass , hasIntroductions );
231
230
}
232
231
233
- public boolean matches (Method method , Class targetClass ) {
232
+ public boolean matches (Method method , Class <?> targetClass ) {
234
233
return this .mm1 .matches (method , targetClass ) && this .mm2 .matches (method , targetClass );
235
234
}
236
235
237
236
public boolean isRuntime () {
238
237
return this .mm1 .isRuntime () || this .mm2 .isRuntime ();
239
238
}
240
239
241
- public boolean matches (Method method , Class targetClass , Object [] args ) {
240
+ public boolean matches (Method method , Class <?> targetClass , Object [] args ) {
242
241
// Because a dynamic intersection may be composed of a static and dynamic part,
243
242
// we must avoid calling the 3-arg matches method on a dynamic matcher, as
244
243
// it will probably be an unsupported operation.
0 commit comments