Class LocatedMessage

Direct Known Subclasses:
WarningMessage

public class LocatedMessage extends SimpleMessage
A base class for compilation messages.
  • Constructor Details

    • LocatedMessage

      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
    • LocatedMessage

      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 Details

    • getContext

      public CSTNode getContext()
      Returns the CST node that identifies the message location.
      Returns:
      the source location node
    • write

      public void write(PrintWriter writer, Janitor janitor)
      Writes the message together with source-location information.
      Overrides:
      write in class SimpleMessage
      Parameters:
      writer - the destination writer
      janitor - the cleanup helper for temporary source access