org.springframework.aop.aspectj

Class AspectJExpressionPointcut

    • Constructor Detail

      • AspectJExpressionPointcut

        public AspectJExpressionPointcut()
        Create a new default AspectJExpressionPointcut.
      • AspectJExpressionPointcut

        public AspectJExpressionPointcut(java.lang.Class<?> declarationScope,
                                         java.lang.String[] paramNames,
                                         java.lang.Class<?>[] paramTypes)
        Create a new AspectJExpressionPointcut with the given settings.
        Parameters:
        declarationScope - the declaration scope for the pointcut
        paramNames - the parameter names for the pointcut
        paramTypes - the parameter types for the pointcut
    • Method Detail

      • setPointcutDeclarationScope

        public void setPointcutDeclarationScope(java.lang.Class<?> pointcutDeclarationScope)
        Set the declaration scope for the pointcut.
      • setParameterNames

        public void setParameterNames(java.lang.String... names)
        Set the parameter names for the pointcut.
      • setParameterTypes

        public void setParameterTypes(java.lang.Class<?>... types)
        Set the parameter types for the pointcut.
      • getClassFilter

        public ClassFilter getClassFilter()
        Description copied from interface: Pointcut
        Return the ClassFilter for this pointcut.
        Specified by:
        getClassFilter in interface Pointcut
        Returns:
        the ClassFilter (never null)
      • getMethodMatcher

        public MethodMatcher getMethodMatcher()
        Description copied from interface: Pointcut
        Return the MethodMatcher for this pointcut.
        Specified by:
        getMethodMatcher in interface Pointcut
        Returns:
        the MethodMatcher (never null)
      • getPointcutExpression

        public org.aspectj.weaver.tools.PointcutExpression getPointcutExpression()
        Return the underlying AspectJ pointcut expression.
      • matches

        public boolean matches(java.lang.Class<?> targetClass)
        Description copied from interface: ClassFilter
        Should the pointcut apply to the given interface or target class?
        Specified by:
        matches in interface ClassFilter
        Parameters:
        targetClass - the candidate target class
        Returns:
        whether the advice should apply to the given target class
      • matches

        public boolean matches(java.lang.reflect.Method method,
                               java.lang.Class<?> targetClass,
                               boolean hasIntroductions)
        Description copied from interface: IntroductionAwareMethodMatcher
        Perform static checking whether the given method matches. This may be invoked instead of the 2-arg MethodMatcher.matches(java.lang.reflect.Method, Class) method if the caller supports the extended IntroductionAwareMethodMatcher interface.
        Specified by:
        matches in interface IntroductionAwareMethodMatcher
        Parameters:
        method - the candidate method
        targetClass - the target class
        hasIntroductions - true if the object on whose behalf we are asking is the subject on one or more introductions; false otherwise
        Returns:
        whether or not this method matches statically
      • matches

        public boolean matches(java.lang.reflect.Method method,
                               java.lang.Class<?> targetClass,
                               java.lang.Object... args)
        Description copied from interface: MethodMatcher
        Check whether there a runtime (dynamic) match for this method, which must have matched statically.

        This method is invoked only if the 2-arg matches method returns true for the given method and target class, and if the MethodMatcher.isRuntime() method returns true. Invoked immediately before potential running of the advice, after any advice earlier in the advice chain has run.

        Specified by:
        matches in interface MethodMatcher
        Parameters:
        method - the candidate method
        targetClass - the target class
        args - arguments to the method
        Returns:
        whether there's a runtime match
        See Also:
        MethodMatcher.matches(Method, Class)
      • getCurrentProxiedBeanName

        @Nullable
        protected java.lang.String getCurrentProxiedBeanName()
      • equals

        public boolean equals(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object