A rule that decides which members of which beans an advisor's advice applies to.
Each PointcutAdvisor pairs one with its advice. Most code never
implements it: aspects write pointcut expressions, and in code an
ExpressionPointcut takes the same syntax. Implement it when the rule
is easier to write in Dart, such as a test on the member's
annotations. matches runs once per member of each proxied bean, at
startup, not on every call. It is named AopPointcut because
@Pointcut is the annotation.
Unlike Spring's ClassFilter + MethodMatcher pair, one check sees
both the member signature and the bean name.
// Advises the read-only members: find* methods and getters.
final class ReadOnlyPointcut implements AopPointcut {
const ReadOnlyPointcut();
@override
bool matches(MethodSignature signature, String beanName) =>
signature.name.startsWith('find') ||
signature.kind == MemberKind.getter;
}
Spring (Java):
class ReadOnlyPointcut extends StaticMethodMatcherPointcut {
public boolean matches(Method method, Class<?> targetClass) {
return method.getName().startsWith("find");
}
}
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
matches(
MethodSignature signature, String beanName) → bool -
Whether the advice applies to the member described by
signatureof the bean namedbeanName. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited