Package org.codehaus.groovy.control
Enum Class ErrorFormat
- All Implemented Interfaces:
Serializable,Comparable<ErrorFormat>,Constable
How compilation errors and warnings are rendered (GROOVY-12312).
Each constant is a renderer which owns the layout of a whole report; the
Message classes only say what went wrong and where, via
Message.toDiagnostic(). A format is selected with
CompilerConfiguration.setErrorFormat(ErrorFormat) and applied by
ErrorCollector.write(PrintWriter, Janitor). Adding a layout means adding
a constant here, not touching the messages.
- Since:
- 6.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe default, human-oriented rendering: each message asMessage.write(PrintWriter, Janitor)lays it out, typically with the offending source line and a caret marking the column, followed by a blank line; then a count per severity.One line per diagnostic, in thefile:line:column: severity: messageform understood by most editors and CI log parsers; then a count per severity. -
Method Summary
Modifier and TypeMethodDescriptiontoString()The lower-case form used on the command line and in help text, e.g.static ErrorFormatReturns the enum constant of this class with the specified name.static ErrorFormat[]values()Returns an array containing the constants of this enum class, in the order they are declared.abstract voidwrite(PrintWriter writer, Janitor janitor, List<? extends Message> warnings, List<? extends Message> errors, boolean debug) Renders a complete report: the warnings, then the errors.
-
Enum Constant Details
-
FULL
The default, human-oriented rendering: each message asMessage.write(PrintWriter, Janitor)lays it out, typically with the offending source line and a caret marking the column, followed by a blank line; then a count per severity. -
SHORT
One line per diagnostic, in thefile:line:column: severity: messageform understood by most editors and CI log parsers; then a count per severity. The source line and caret are omitted, and a message spanning several lines is joined into one. Parts a message does not have are dropped rather than guessed: no file when there is no source unit, no line and column when there is no position.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
write
public abstract void write(PrintWriter writer, Janitor janitor, List<? extends Message> warnings, List<? extends Message> errors, boolean debug) Renders a complete report: the warnings, then the errors.- Parameters:
writer- the destinationjanitor- the cleanup helper for temporary source access, may benullwarnings- the warnings, may benullor emptyerrors- the errors, may benullor emptydebug- whether to follow each syntax error with its stack trace
-
toString
The lower-case form used on the command line and in help text, e.g.short. picocli matches an option value against this as well asEnum.name(), so--error-format=shortand--error-format=SHORTboth parse.- Overrides:
toStringin classEnum<ErrorFormat>
-