Example usage for org.aspectj.weaver.tools PointcutExpression couldMatchJoinPointsInType

List of usage examples for org.aspectj.weaver.tools PointcutExpression couldMatchJoinPointsInType

Introduction

In this page you can find the example usage for org.aspectj.weaver.tools PointcutExpression couldMatchJoinPointsInType.

Prototype

boolean couldMatchJoinPointsInType(Class aClass);

Source Link

Document

Determine whether or not this pointcut could ever match a join point in the given class.

Usage

From source file:org.springframework.aop.aspectj.AspectJExpressionPointcut.java

License:Apache License

@Override
public boolean matches(Class<?> targetClass) {
    checkReadyToMatch();//  w  w  w . j  av a2s . c  o m
    try {
        try {
            return this.pointcutExpression.couldMatchJoinPointsInType(targetClass);
        } catch (ReflectionWorldException ex) {
            logger.debug("PointcutExpression matching rejected target class - trying fallback expression", ex);
            // Actually this is still a "maybe" - treat the pointcut as dynamic if we don't know enough yet
            PointcutExpression fallbackExpression = getFallbackPointcutExpression(targetClass);
            if (fallbackExpression != null) {
                return fallbackExpression.couldMatchJoinPointsInType(targetClass);
            }
        }
    } catch (BCException ex) {
        logger.debug("PointcutExpression matching rejected target class", ex);
    }
    return false;
}