Package fmpp.progresslisteners
Class ConsoleProgressListener
java.lang.Object
fmpp.progresslisteners.ConsoleProgressListener
- All Implemented Interfaces:
ProgressListener
Designed to show the progress on console screen.
-
Field Summary
Fields inherited from interface fmpp.ProgressListener
EVENT_BEGIN_FILE_PROCESSING, EVENT_BEGIN_PROCESSING_SESSION, EVENT_CREATED_EMPTY_DIR, EVENT_END_FILE_PROCESSING, EVENT_END_PROCESSING_SESSION, EVENT_IGNORING_DIR, EVENT_SOURCE_NOT_MODIFIED, EVENT_WARNING -
Constructor Summary
ConstructorsConstructorDescriptionOutput will be printed to the stdout.ConsoleProgressListener(OutputStream out, boolean quiet) ConsoleProgressListener(PrintWriter out, boolean quiet) -
Method Summary
Modifier and TypeMethodDescriptionvoidnotifyProgressEvent(Engine engine, int event, File src, int pMode, Throwable error, Object param) Method called be the engine to notify events.
-
Constructor Details
-
ConsoleProgressListener
public ConsoleProgressListener()Output will be printed to the stdout. -
ConsoleProgressListener
-
ConsoleProgressListener
-
ConsoleProgressListener
- Parameters:
quiet- Print warnings and skipped errors only
-
ConsoleProgressListener
- Parameters:
quiet- Print warnings and skipped errors only
-
-
Method Details
-
notifyProgressEvent
public void notifyProgressEvent(Engine engine, int event, File src, int pMode, Throwable error, Object param) Description copied from interface:ProgressListenerMethod called be the engine to notify events.It is guaranteed that this method will not be called concurrently as far as the listener is added to a single
Engineinstance only.- Specified by:
notifyProgressEventin interfaceProgressListener- Parameters:
engine- The engine instance where the event has occurred.event- The code of the event: anEVENT_...constant. As new event types can be introduced with new FMPP versions (even if it happens very seldom), a progress listener implementation should survive events that it does not understand. That is, it must not stop with an error, but it should silently ignore the event.src- Depending oneventthe source file or null.pMode- Depending oneventthe proccessing mode (Engine.PMODE_...constant) orEngine.PMODE_NONE. Note that new processing modes may be added as FMPP evolvers, so values that are not known be the progress listener should be handler nicely, and never cause error.error- The error, or null if there was no error.param- Extra information about the event. The class and meaning of object depends on the concrete event:- For
EVENT_WARNINGit is aStringthat describles the reason of warning.
- For
-