Package net.sourceforge.pmd.reporting
Interface ListenerInitializer
-
- All Superinterfaces:
AutoCloseable
public interface ListenerInitializer extends AutoCloseable
An initializer forGlobalAnalysisListener
that gets notified of general analysis parameters. Each method will be called exactly once, before any events on theGlobalAnalysisListener
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description default void
close()
Signals the end of initialization: no further calls will be made to this object.static ListenerInitializer
noop()
A listener that does nothing.default void
setNumberOfFilesToAnalyze(int totalFiles)
Notifies the total number of files collected for analysis.static ListenerInitializer
tee(Collection<? extends ListenerInitializer> listeners)
Produce an analysis listener that forwards all events to the given listeners.
-
-
-
Method Detail
-
setNumberOfFilesToAnalyze
default void setNumberOfFilesToAnalyze(int totalFiles)
Notifies the total number of files collected for analysis.
-
close
default void close() throws Exception
Signals the end of initialization: no further calls will be made to this object.- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
- If an exception occurs, eg IOException when writing to a renderer
-
noop
static ListenerInitializer noop()
A listener that does nothing.
-
tee
static ListenerInitializer tee(Collection<? extends ListenerInitializer> listeners)
Produce an analysis listener that forwards all events to the given listeners.- Parameters:
listeners
- Listeners- Returns:
- A new listener
- Throws:
IllegalArgumentException
- If the parameter is emptyNullPointerException
- If the parameter or any of its elements is null
-
-