Class Message
java.lang.Object
org.codehaus.groovy.control.messages.Message
- Direct Known Subclasses:
ExceptionMessage,SimpleMessage,SyntaxErrorMessage
A base class for compilation messages.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Messagecreate(String text, Object data, ProcessingUnit owner) Creates a newMessagefrom the specified text and data.static Messagecreate(String text, ProcessingUnit owner) Creates a newMessagefrom the specified text.static Messagecreate(SyntaxException error, SourceUnit owner) Creates a newMessagefrom the specifiedSyntaxException.Returns a format-neutral view of this message: its text and, when known, the source and position it applies to.final voidwrite(PrintWriter writer) Writes this message to the specifiedPrintWriter.abstract voidwrite(PrintWriter writer, Janitor janitor) Writes this message to the specifiedPrintWriter.
-
Constructor Details
-
Message
public Message()
-
-
Method Details
-
create
Creates a newMessagefrom the specified text. -
create
Creates a newMessagefrom the specified text and data. -
create
Creates a newMessagefrom the specifiedSyntaxException. -
write
Writes this message to the specifiedPrintWriter. This is the full, human-oriented rendering; other layouts are produced byErrorFormatfromtoDiagnostic(). -
write
Writes this message to the specifiedPrintWriter. -
toDiagnostic
Returns a format-neutral view of this message: its text and, when known, the source and position it applies to. Layouts other than the full one are rendered from this rather than from the message classes (GROOVY-12312).The default captures the output of
write(PrintWriter)as the text, with no file or position, so that a subclass which does not override this still renders in every format.- Returns:
- the diagnostic view, never
null - Since:
- 6.0.0
-