Package org.codehaus.groovy.control.messages

# Class SimpleMessage

java.lang.Object
org.codehaus.groovy.control.messages.Message
org.codehaus.groovy.control.messages.SimpleMessage

Direct Known Subclasses:
  `LocatedMessage`

public class SimpleMessage extends Message
A base class for compilation messages.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Object`
  `data`
  used when `message` is an I18N identifier
  `protected String`
  `message`
  Message text to render.
  `protected ProcessingUnit`
  `owner`
  Processing unit that owns the message.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SimpleMessage(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 Type
  Method
  Description
  `String`
  `getMessage()`
  Returns the message text.
  `void`
  `write(PrintWriter writer, Janitor janitor)`
  Writes this message, prefixing it with the source name when available.

  ### Methods inherited from class org.codehaus.groovy.control.messages.Message

  `create, create, create, write`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### data

    protected Object data
    used when `message` is an I18N identifier

  - ### message

    protected String message
    Message text to render.

  - ### owner

    protected ProcessingUnit owner
    Processing unit that owns the message.

- ## Constructor Details

  - ### SimpleMessage

    public SimpleMessage(String message, ProcessingUnit owner)
    Creates a simple message with no auxiliary data.
    Parameters:
      `message` - the message text
      `owner` - the owning processing unit

  - ### SimpleMessage

    public SimpleMessage(String message, Object data, ProcessingUnit owner)
    Creates a simple message with optional auxiliary data.
    Parameters:
      `message` - the message text
      `data` - supplemental message data
      `owner` - the owning processing unit

- ## Method Details

  - ### getMessage

    public String getMessage()
    Returns the message text.
    Returns:
      the message text

  - ### write

    public void write(PrintWriter writer, Janitor janitor)
    Writes this message, prefixing it with the source name when available.
    Specified by:
      `write` in class `Message`
    Parameters:
      `writer` - the destination writer
      `janitor` - the cleanup helper for temporary source access