Class AnnotationFilter

    • Method Detail

      • getAnnotationType

        public String getAnnotationType()
        Returns:
        the annotation type descriptor to match (e.g. "Ljavax/inject/Inject;")
      • isMatchPresent

        public boolean isMatchPresent()
        Returns:
        whether the filter matches when the annotation is present (false matches when absent)
      • isCheckClass

        public boolean isCheckClass()
        Returns:
        whether class annotations are checked
      • isCheckMethod

        public boolean isCheckMethod()
        Returns:
        whether method annotations are checked
      • matchesClass

        public boolean matchesClass​(ClassFile classFile)
        Description copied from interface: InstrumentationFilter
        Checks if the given class matches this filter.
        Specified by:
        matchesClass in interface InstrumentationFilter
        Parameters:
        classFile - the class file to check
        Returns:
        true if the class matches, false otherwise
      • matchesMethod

        public boolean matchesMethod​(MethodEntry method)
        Description copied from interface: InstrumentationFilter
        Checks if the given method matches this filter.
        Specified by:
        matchesMethod in interface InstrumentationFilter
        Parameters:
        method - the method entry to check
        Returns:
        true if the method matches, false otherwise
      • matchesField

        public boolean matchesField​(String fieldOwner,
                                    String fieldName,
                                    String fieldDescriptor)
        Description copied from interface: InstrumentationFilter
        Checks if the given field matches this filter.
        Specified by:
        matchesField in interface InstrumentationFilter
        Parameters:
        fieldOwner - the class owning the field (internal name)
        fieldName - the field name
        fieldDescriptor - the field type descriptor
        Returns:
        true if the field matches, false otherwise
      • matchesMethodCall

        public boolean matchesMethodCall​(String owner,
                                         String name,
                                         String descriptor)
        Description copied from interface: InstrumentationFilter
        Checks if the given method call matches this filter.
        Specified by:
        matchesMethodCall in interface InstrumentationFilter
        Parameters:
        owner - the class being called (internal name)
        name - the method name
        descriptor - the method descriptor
        Returns:
        true if the call matches, false otherwise
      • forAnnotation

        public static AnnotationFilter forAnnotation​(String annotationType)
        Creates a filter that matches methods with the given annotation.
        Parameters:
        annotationType - the annotation type descriptor
        Returns:
        the filter
      • withoutAnnotation

        public static AnnotationFilter withoutAnnotation​(String annotationType)
        Creates a filter that matches methods without the given annotation.
        Parameters:
        annotationType - the annotation type descriptor
        Returns:
        the filter