Interface Filter<T>

All Known Implementing Classes:
AbstractFilter, AbstractPatternFilter, FileFilterAdapter, PatternFileFilter, PatternURLFilter

public interface Filter<T>
Generic Filter specification, whose implementations define if candidate objects should be accepted or not.
Since:
2.0
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    accept(T candidate)
    Method that is invoked to determine if a candidate instance should be accepted or not.
    void
    initialize(org.apache.maven.plugin.logging.Log log)
    Initializes this Filter, and assigns the supplied Log for use by this Filter.
    boolean
     
  • Method Details

    • initialize

      void initialize(org.apache.maven.plugin.logging.Log log)
      Initializes this Filter, and assigns the supplied Log for use by this Filter.
      Parameters:
      log - The non-null Log which should be used by this Filter to emit log messages.
    • isInitialized

      boolean isInitialized()
      Returns:
      true if this Filter has been properly initialized (by a call to the initialize method).
    • accept

      boolean accept(T candidate) throws IllegalStateException

      Method that is invoked to determine if a candidate instance should be accepted or not. Implementing classes should be prepared to handle null candidate objects.

      Parameters:
      candidate - The candidate that should be tested for acceptance by this Filter.
      Returns:
      true if the candidate is accepted by this Filter and false otherwise.
      Throws:
      IllegalStateException - if this Filter is not initialized by a call to the initialize method before calling this matchAtLeastOnce method.