Class SimpleMessage
java.lang.Object
org.codehaus.groovy.control.messages.Message
org.codehaus.groovy.control.messages.SimpleMessage
- Direct Known Subclasses:
LocatedMessage
A base class for compilation messages.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSimpleMessage(String message, Object data, ProcessingUnit owner) Creates a simple message with optional auxiliary data.SimpleMessage(String message, ProcessingUnit owner) Creates a simple message with no auxiliary data. -
Method Summary
Modifier and TypeMethodDescriptionReturns the message text.Returns a format-neutral view of this message: its text and, when known, the source and position it applies to.voidwrite(PrintWriter writer, Janitor janitor) Writes this message, prefixing it with the source name when available.
-
Field Details
-
data
used whenmessageis an I18N identifier -
message
Message text to render. -
owner
Processing unit that owns the message.
-
-
Constructor Details
-
SimpleMessage
Creates a simple message with no auxiliary data.- Parameters:
message- the message textowner- the owning processing unit
-
SimpleMessage
Creates a simple message with optional auxiliary data.- Parameters:
message- the message textdata- supplemental message dataowner- the owning processing unit
-
-
Method Details
-
getMessage
Returns the message text.- Returns:
- the message text
-
toDiagnostic
Description copied from class:MessageReturns 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
Message.write(PrintWriter)as the text, with no file or position, so that a subclass which does not override this still renders in every format.- Overrides:
toDiagnosticin classMessage- Returns:
- the diagnostic view, never
null
-
write
Writes this message, prefixing it with the source name when available.
-