Class FilterByPropertyRegex

  • All Implemented Interfaces:
    FilterBy

    public class FilterByPropertyRegex
    extends Object
    implements FilterBy
    Filters resources by a given property using regular expression matching. In case the property name is null all properties will be checked if there is any match. This only works for single value properties.
    Author:
    Roland Gruber
    • Constructor Detail

      • FilterByPropertyRegex

        public FilterByPropertyRegex​(String name,
                                     @Nonnull
                                     String regex)
        Constructor
        Parameters:
        name - property name or null for all properties
        regex - regular expression
    • Method Detail

      • filter

        public boolean filter​(@Nonnull
                              org.apache.sling.api.resource.Resource resource,
                              StringBuilder output)
        Description copied from interface: FilterBy
        Checks if the given resource matches the filter criteria.
        Specified by:
        filter in interface FilterBy
        Parameters:
        resource - resource
        output - output buffer
        Returns:
        matches