Class ClassFilter

    • Constructor Detail

      • ClassFilter

        public ClassFilter​(String pattern)
        Creates a class filter with the given pattern.
        Parameters:
        pattern - the class name pattern (internal format, e.g., "com/example/MyClass") Use '*' for wildcards (e.g., "com/example/*" or "com/example/**")
    • Method Detail

      • getPattern

        public String getPattern()
        Returns:
        the pattern
      • isWildcard

        public boolean isWildcard()
        Returns:
        whether wildcard
      • getRegex

        public Pattern getRegex()
        Returns:
        the regex
      • 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
      • exact

        public static ClassFilter exact​(String className)
        Creates a filter that matches a single class exactly.
        Parameters:
        className - the class name, in either dotted or internal form
        Returns:
        the filter
      • matching

        public static ClassFilter matching​(String pattern)
        Creates a filter that matches classes using a wildcard pattern.
        Parameters:
        pattern - the glob pattern, where '*' stays within one path segment and '**' spans segments
        Returns:
        the filter