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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaccept(T candidate)Method that is invoked to determine if a candidate instance should be accepted or not.voidinitialize(org.apache.maven.plugin.logging.Log log)Initializes this Filter, and assigns the supplied Log for use by this Filter.booleanisInitialized()
-
-
-
Method Detail
-
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:
trueif this Filter has been properly initialized (by a call to theinitializemethod).
-
accept
boolean accept(T candidate) throws java.lang.IllegalStateException
Method that is invoked to determine if a candidate instance should be accepted or not. Implementing classes should be prepared to handle
nullcandidate objects.- Parameters:
candidate- The candidate that should be tested for acceptance by this Filter.- Returns:
trueif the candidate is accepted by this Filter andfalseotherwise.- Throws:
java.lang.IllegalStateException- if this Filter is not initialized by a call to the initialize method before calling this matchAtLeastOnce method.
-
-