Package: org.codehaus.groovy.control.messages

## [Java] Class LocatedMessage

- org.codehaus.groovy.control.messages.LocatedMessage

-     public class LocatedMessage
      extends SimpleMessage

  A base class for compilation messages.

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class SimpleMessage` | `data, message, owner`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `LocatedMessage(String message, CSTNode context, SourceUnit source)` Creates a located message with the supplied text.
    `LocatedMessage(String message, Object data, CSTNode context, SourceUnit source)` Creates a located message with supplemental data.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public CSTNode` | `getContext()` Returns the CST node that identifies the message location.
    `` | `public void` | `write(PrintWriter writer, Janitor janitor)` Writes the message together with source-location information.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class SimpleMessage` | `getMessage, write`
    `class Message` | `create, create, create, write, write`

- - ### Constructor Detail

    - #### public LocatedMessage(String message, CSTNode context, SourceUnit source)

      Creates a located message with the supplied text.

      Parameters:
        `message` - the message text
        `context` - the source location
        `source` - the owning source unit

    - #### public LocatedMessage(String message, Object data, CSTNode context, SourceUnit source)

      Creates a located message with supplemental data.

      Parameters:
        `message` - the message text
        `data` - supplemental message data
        `context` - the source location
        `source` - the owning source unit

  - ### Method Detail

    - #### public CSTNode getContext()

      Returns the CST node that identifies the message location.

      Returns:
        the source location node

    - #### public void write(PrintWriter writer, Janitor janitor)

      Writes the message together with source-location information.

      Parameters:
        `writer` - the destination writer
        `janitor` - the cleanup helper for temporary source access