pointcutMatchesBean function
bool
pointcutMatchesBean(
- AopPointcut pointcut,
- MethodSignature signature,
- String beanName,
- List<
String> beanAliases, { - List<
String> introducedTypes = const [],
Whether pointcut matches the member signature of the bean
beanName, with everything the bean is known by.
AopPointcut.matches sees only the bean name. The pointcuts that test
names or types (ExpressionPointcut, ComposablePointcut) also get the
bean's aliases and qualifier values (beanAliases), for bean(...),
and the interfaces @DeclareParents adds to its proxy
(introducedTypes), for this(...). The proxy machinery calls this;
call it too when matching pointcuts yourself, for example in a test.
// Does the advisor apply to `find` of the bean also known as
// primaryOrders?
pointcutMatchesBean(pointcut, signature, 'orders', ['primaryOrders']);
Implementation
bool pointcutMatchesBean(
AopPointcut pointcut,
MethodSignature signature,
String beanName,
List<String> beanAliases, {
List<String> introducedTypes = const [],
}) => switch (pointcut) {
final ExpressionPointcut p => p.matchesBean(
signature,
beanName,
beanAliases,
introducedTypes: introducedTypes,
),
final ComposablePointcut p => p.matchesBean(
signature,
beanName,
beanAliases,
introducedTypes: introducedTypes,
),
_ => pointcut.matches(signature, beanName),
};