Class FieldFilter

    • Constructor Detail

      • FieldFilter

        public FieldFilter​(String namePattern)
        Creates a field filter matching by name only.
        Parameters:
        namePattern - the field name pattern (use '*' for wildcards)
      • FieldFilter

        public FieldFilter​(String ownerPattern,
                           String namePattern,
                           String typePattern)
        Creates a field filter with full pattern support.
        Parameters:
        ownerPattern - the owner class pattern (null for any)
        namePattern - the field name pattern (null for any)
        typePattern - the type descriptor pattern (null for any)
    • Method Detail

      • getOwnerPattern

        public String getOwnerPattern()
        Returns:
        the owner pattern
      • getNamePattern

        public String getNamePattern()
        Returns:
        the name pattern
      • getTypePattern

        public String getTypePattern()
        Returns:
        the type pattern
      • getOwnerRegex

        public Pattern getOwnerRegex()
        Returns:
        the owner regex
      • getNameRegex

        public Pattern getNameRegex()
        Returns:
        the name regex
      • getTypeRegex

        public Pattern getTypeRegex()
        Returns:
        the type regex
      • matchesField

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

        public static FieldFilter named​(String name)
        Creates a filter matching an exact field name.
        Parameters:
        name - the field name to match
        Returns:
        a filter constrained to that name
      • forField

        public static FieldFilter forField​(String name)
        Creates a filter matching a field by name.
        Parameters:
        name - the field name to match
        Returns:
        a filter constrained to that name
      • matching

        public static FieldFilter matching​(String pattern)
        Creates a filter matching fields by pattern (wildcard support).
        Parameters:
        pattern - the field name pattern, where '*' matches any run of characters
        Returns:
        a filter constrained to names matching the pattern
      • ofType

        public static FieldFilter ofType​(String typeDescriptor)
        Creates a filter matching fields of a specific type.
        Parameters:
        typeDescriptor - the field descriptor pattern, where '*' matches any run of characters
        Returns:
        a filter constrained to that descriptor
      • inClass

        public static FieldFilter inClass​(String ownerClass)
        Creates a filter matching all fields in a specific class.
        Parameters:
        ownerClass - the owner pattern, where '*' matches any run of characters
        Returns:
        a filter constrained to that owner
      • specific

        public static FieldFilter specific​(String owner,
                                           String name)
        Creates a filter matching a specific field.
        Parameters:
        owner - the owner pattern
        name - the field name pattern
        Returns:
        a filter constrained to that owner and name