aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/ContextBasedMatcher.java
blob: 073f16cd75b29b59c1b94dbc112a83c3adb27d78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* *******************************************************************
 * Copyright (c) 2005 Contributors.
 * All rights reserved.
 * This program and the accompanying materials are made available
 * under the terms of the Eclipse Public License v 2.0
 * which accompanies this distribution and is available at
 * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
 *
 * Contributors:
 *   Adrian Colyer			Initial implementation
 * ******************************************************************/
package org.aspectj.weaver.tools;

/**
 * Pointcut expression interface for pointcut
 * expressions returned by a
 * PointcutDesignatorHandler. Provides an additional
 * matching method for matching based on context
 * information over and above that normally used
 * by AspectJ.
 *
 * @see MatchingContext
 *
 */
public interface ContextBasedMatcher {

	/**
	 * return true iff this matcher could ever match
	 * a join point in the given type
	 * @deprecated use couldMatchJoinPointsInType(Class,MatchingContext) instead
	 */
	boolean couldMatchJoinPointsInType(Class aClass);

	/**
	 * return true iff this matcher could ever match
	 * a join point in the given type, may also use any
	 * match context information available
	 * @since 1.5.1
	 */
	boolean couldMatchJoinPointsInType(Class aClass, MatchingContext matchContext);

	/**
	 * return true if matchesStatically can ever return
	 * FuzzyBoolean.MAYBE (necessitating a per-join point test
	 * to determine matching at a given join point).
	 */
	boolean mayNeedDynamicTest();

	/**
	 * Return FuzzyBoolean.YES if a join point with the given
	 * matching context is always matched.
	 * Return FuzzyBoolean.NO if a join point with the given
	 * matching context is never matched.
	 * Return FuzzyBoolean.MAYBE if a match cannot be determined
	 * statically (whilst generating a ShadowMatch), and must
	 * be determined on a per-join point basis.
	 */
	FuzzyBoolean matchesStatically(MatchingContext matchContext);

	/**
	 * Called during processing of ShadowMatch.matchesJoinPoint
	 * when matchesStatically returned FuzzyBoolean.MAYBE.
	 */
	boolean matchesDynamically(MatchingContext matchContext);
}