public class GathererPrinterHelper extends Object implements PrinterGatherer
Constructor and Description |
---|
GathererPrinterHelper() |
Modifier and Type | Method and Description |
---|---|
void |
printErrors(NotificationGatherer notificationGatherer,
ProcessingEnvironment processingEnv,
Context context) |
void |
printKind(List<Notification> notificationsNotes,
ProcessingEnvironment processingEnv,
Context context,
Diagnostic.Kind kind,
String singular,
String plural)
Given a list of
Notification s, and a criteria to print them (see Diagnostic.Kind ), it will iterate
over the list to describe while sorting them in a pretty way. |
void |
printNotes(NotificationGatherer notificationGatherer,
ProcessingEnvironment processingEnv,
Context context) |
void |
printWarnings(NotificationGatherer notificationGatherer,
ProcessingEnvironment processingEnv,
Context context) |
public void printErrors(NotificationGatherer notificationGatherer, ProcessingEnvironment processingEnv, Context context)
printErrors
in interface PrinterGatherer
public void printWarnings(NotificationGatherer notificationGatherer, ProcessingEnvironment processingEnv, Context context)
printWarnings
in interface PrinterGatherer
public void printNotes(NotificationGatherer notificationGatherer, ProcessingEnvironment processingEnv, Context context)
printNotes
in interface PrinterGatherer
public void printKind(List<Notification> notificationsNotes, ProcessingEnvironment processingEnv, Context context, Diagnostic.Kind kind, String singular, String plural)
Given a list of Notification
s, and a criteria to print them (see Diagnostic.Kind
), it will iterate
over the list to describe while sorting them in a pretty way. If the list is empty, it will print nothing.
Sample of the output after calling this method for an ERROR scenario:
[ERROR] ***************************************************
The following (4) errors where encountered while compiling:
File: /
This method ensures that, in any error scenario, the complete list will be printed in the user's console. This
means that, if an exception is thrown while sorting the errors and make them pretty (by invoking getCompleteNotificationLog(java.util.List, javax.annotation.processing.ProcessingEnvironment, String, String)
)
the COMPLETE list of errors will be printed in the default way.
Sample of the output after calling this method for an ERROR scenario but with some troubles while printing:
[ERROR] /
notificationsNotes
- the list of notifications to be printed while sortedprocessingEnv
- the environment to process the file pathscontext
- the context needed to print the messageskind
- the type of error we want to be displayedsingular
- the label used to describe the header if there is ONE notification in the listplural
- the label used to describe the header if there is TWO (or more) notifications in the listCopyright © 2010–2015 MuleSoft, Inc.. All rights reserved.