Class FilterByHasProperty

  • All Implemented Interfaces:
    FilterBy

    public class FilterByHasProperty
    extends Object
    implements FilterBy
    Filters resources by the existence a given property. The filter only matches if the attribute exists. The value of the property is not relevant.
    Author:
    Roland Gruber
    • Constructor Detail

      • FilterByHasProperty

        public FilterByHasProperty​(@Nonnull
                                   String name)
        Constructor
        Parameters:
        name - attribute name
    • 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