org.springframework.aop.support.annotation

Class AnnotationClassFilter

  • java.lang.Object
    • org.springframework.aop.support.annotation.AnnotationClassFilter
  • All Implemented Interfaces:
    ClassFilter


    public class AnnotationClassFilter
    extends java.lang.Object
    implements ClassFilter
    Simple ClassFilter that looks for a specific Java 5 annotation being present on a class.
    Since:
    2.0
    Author:
    Juergen Hoeller
    See Also:
    AnnotationMatchingPointcut
    • Field Summary

    • Constructor Summary

      Constructors 
      Constructor and Description
      AnnotationClassFilter(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
      Create a new AnnotationClassFilter for the given annotation type.
      AnnotationClassFilter(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType, boolean checkInherited)
      Create a new AnnotationClassFilter for the given annotation type.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object other) 
      int hashCode() 
      boolean matches(java.lang.Class<?> clazz)
      Should the pointcut apply to the given interface or target class?
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AnnotationClassFilter

        public AnnotationClassFilter(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
        Create a new AnnotationClassFilter for the given annotation type.
        Parameters:
        annotationType - the annotation type to look for
      • AnnotationClassFilter

        public AnnotationClassFilter(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType,
                                     boolean checkInherited)
        Create a new AnnotationClassFilter for the given annotation type.
        Parameters:
        annotationType - the annotation type to look for
        checkInherited - whether to also check the superclasses and interfaces as well as meta-annotations for the annotation type (i.e. whether to use AnnotatedElementUtils.hasAnnotation(java.lang.reflect.AnnotatedElement, java.lang.Class<? extends java.lang.annotation.Annotation>) semantics instead of standard Java Class.isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation>))
    • Method Detail

      • matches

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