Class FileFilterAdapter
java.lang.Object
org.codehaus.mojo.jaxb2.shared.filters.AbstractFilter<File>
org.codehaus.mojo.jaxb2.shared.filters.pattern.FileFilterAdapter
- All Implemented Interfaces:
FileFilter
,Filter<File>
Filter implementation adapting a FileFilter instance to the Filter interface.
Delegates the
onCandidate(File)
call to the supplied FileFilter
delegate.- Since:
- 2.3
-
Field Summary
FieldsFields inherited from class org.codehaus.mojo.jaxb2.shared.filters.AbstractFilter
log, TOSTRING_INDENT
-
Constructor Summary
ConstructorsConstructorDescriptionFileFilterAdapter
(FileFilter delegate) Compound constructor, creating a FileFilterAdapter using the suppliedFileFilter
to determine if candidate Files should be accepted. -
Method Summary
Modifier and TypeMethodDescriptionboolean
protected boolean
onCandidate
(File nonNullCandidate) Method that is invoked to determine if a candidate instance should be accepted or not.void
setDelegate
(FileFilter delegate) Assigns the supplied FileFilter delegate.Methods inherited from class org.codehaus.mojo.jaxb2.shared.filters.AbstractFilter
accept, addDelayedLogMessage, initialize, onInitialize, onNullCandidate, setProcessNullValues, toString, validateDiSetterCalledBeforeInitialization
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.io.FileFilter
accept
Methods inherited from interface org.codehaus.mojo.jaxb2.shared.filters.Filter
accept, initialize
-
Field Details
-
delegate
-
-
Constructor Details
-
FileFilterAdapter
Compound constructor, creating a FileFilterAdapter using the suppliedFileFilter
to determine if candidate Files should be accepted.- Parameters:
delegate
- The delegate FileFilter.
-
-
Method Details
-
isInitialized
public boolean isInitialized()- Specified by:
isInitialized
in interfaceFilter<File>
- Overrides:
isInitialized
in classAbstractFilter<File>
- Returns:
true
if this Filter has been properly initialized (by a call to theinitialize
method).
-
setDelegate
Assigns the supplied FileFilter delegate.- Parameters:
delegate
- A non-null FileFilter instance.
-
onCandidate
Method that is invoked to determine if a candidate instance should be accepted or not.
- Specified by:
onCandidate
in classAbstractFilter<File>
- Parameters:
nonNullCandidate
- The candidate that should be tested for acceptance by this Filter. Never null.- Returns:
true
if the candidate is accepted by this Filter andfalse
otherwise.
-