Each configured method name pattern can be an exact method name or a
pattern (see isMatch(String, String) for details on the supported
pattern styles).
Note that evaluating such pointcuts is 10-15 times slower than evaluating normal pointcuts, but they are useful in some cases.
NameMatchMethodPointcut, JdkRegexpMethodPointcut
| Modifier and Type | Field and Description |
|---|---|
| protected final Class | clazz
The class against which to match. |
| private final AtomicInteger | |
| protected final List | methodNamePatterns
An immutable list of distinct method name patterns against which to match. |
| Access | Constructor and Description |
|---|---|
| public | ControlFlowPointcut(Class<?>
the class clazz)Construct a new pointcut that matches all control flows below the given class. |
| public | ControlFlowPointcut(Class<?>
the class clazz, String the method name pattern (may be methodNamePattern)null)Construct a new pointcut that matches all calls below a method matching the given method name pattern in the given class. |
| public | ControlFlowPointcut(Class<?>
the class clazz, String... the method name patterns (potentially empty) methodNamePatterns)Construct a new pointcut that matches all calls below a method matching one of the given method name patterns in the given class. |
| public | ControlFlowPointcut(Class<?>
the class clazz, List<String> the method name patterns (potentially empty) methodNamePatterns)Construct a new pointcut that matches all calls below a method matching one of the given method name patterns in the given class. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. |
| public ClassFilter | getClassFilter()
Implements org. |
| public int | |
| public MethodMatcher | getMethodMatcher()
Implements org. |
| public int | |
| protected final void | |
| protected boolean | |
| protected boolean | |
| public boolean | isRuntime()
Implements org. MethodMatcher dynamic, that is, must a final check be made
via the matches(Method, Class, Object[]) method at runtime even
if matches(Method, Class) returns true?
|
| public boolean | matches(Class<?>
the candidate target class clazz)Implements org. |
| public boolean | matches(Method
the candidate method method, Class<?> the target class targetClass)Implements org. |
| public boolean | matches(Method
the candidate method method, Class<?> the target class targetClass, Object... arguments to the method args)Implements org. |
| public String |
| clazz | back to summary |
|---|---|
| protected final Class<?> clazz The class against which to match.
| |
| evaluationCount | back to summary |
|---|---|
| private final AtomicInteger evaluationCount | |
| methodNamePatterns | back to summary |
|---|---|
| protected final List<String> methodNamePatterns An immutable list of distinct method name patterns against which to match.
| |
| ControlFlowPointcut | back to summary |
|---|---|
| public ControlFlowPointcut(Class<?> clazz) Construct a new pointcut that matches all control flows below the given class.
| |
| ControlFlowPointcut | back to summary |
|---|---|
| public ControlFlowPointcut(Class<?> clazz, String methodNamePattern) Construct a new pointcut that matches all calls below a method matching the given method name pattern in the given class. If no method name pattern is given, the pointcut matches all control flows below the given class. | |
| ControlFlowPointcut | back to summary |
|---|---|
| public ControlFlowPointcut(Class<?> clazz, String... methodNamePatterns) Construct a new pointcut that matches all calls below a method matching one of the given method name patterns in the given class. If no method name pattern is given, the pointcut matches all control flows below the given class. | |
| ControlFlowPointcut | back to summary |
|---|---|
| public ControlFlowPointcut(Class<?> clazz, List<String> methodNamePatterns) Construct a new pointcut that matches all calls below a method matching one of the given method name patterns in the given class. If no method name pattern is given, the pointcut matches all control flows below the given class. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getClassFilter | back to summary |
|---|---|
| public ClassFilter getClassFilter() Implements org. Doc from org. Return the ClassFilter for this pointcut.
| |
| getEvaluations | back to summary |
|---|---|
| public int getEvaluations() Get the number of times Useful for optimization and testing purposes. | |
| getMethodMatcher | back to summary |
|---|---|
| public MethodMatcher getMethodMatcher() Implements org. Doc from org. Return the MethodMatcher for this pointcut.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| incrementEvaluationCount | back to summary |
|---|---|
| protected final void incrementEvaluationCount() Increment the
| |
| isMatch | back to summary |
|---|---|
| protected boolean isMatch(String methodName, int patternIndex) Determine if the given method name matches the method name pattern at the specified index. This method is invoked by The default implementation retrieves the method name pattern from
Can be overridden in subclasses — for example, to support regular expressions.
| |
| isMatch | back to summary |
|---|---|
| protected boolean isMatch(String methodName, String methodNamePattern) Determine if the given method name matches the method name pattern. This method is invoked by The default implementation checks for direct equality as well as
Can be overridden in subclasses — for example, to support a different style of simple pattern matching.
| |
| isRuntime | back to summary |
|---|---|
| public boolean isRuntime() Implements org. Doc from org. Is this Can be invoked when an AOP proxy is created, and need not be invoked again before each method invocation.
| |
| matches | back to summary |
|---|---|
| public boolean matches(Class<?> clazz) Implements org. Subclasses can override this for greater filtering (and performance). The default implementation always returns
| |
| matches | back to summary |
|---|---|
| public boolean matches(Method method, Class<?> targetClass) Implements org. Subclasses can override this if it's possible to filter out some candidate classes. The default implementation always returns
| |
| matches | back to summary |
|---|---|
| public boolean matches(Method method, Class<?> targetClass, Object... args) Implements org. Doc from org. Check whether there is a runtime (dynamic) match for this method, which must have matched statically. This method is invoked only if Invoked immediately before potential running of the advice, after any advice earlier in the advice chain has run. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |