Class WarningMessage


  • public class WarningMessage
    extends LocatedMessage
    A class for warning messages.
    • Constructor Summary

      Constructors 
      Constructor Description
      WarningMessage​(int importance, java.lang.String message, java.lang.Object data, CSTNode context, SourceUnit owner)
      Creates a new warning message.
      WarningMessage​(int importance, java.lang.String message, CSTNode context, SourceUnit owner)
      Creates a new warning message.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isRelevant​(int importance)
      Returns true if this message is as or more important than the specified importance level.
      static boolean isRelevant​(int actual, int limit)
      Returns true if a warning would be relevant to the specified level.
      void write​(java.io.PrintWriter writer, Janitor janitor)
      Writes the message to the specified PrintWriter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WarningMessage

        public WarningMessage​(int importance,
                              java.lang.String message,
                              CSTNode context,
                              SourceUnit owner)
        Creates a new warning message.
        Parameters:
        importance - the warning level
        message - the message text
        context - context information for locating the offending source text
      • WarningMessage

        public WarningMessage​(int importance,
                              java.lang.String message,
                              java.lang.Object data,
                              CSTNode context,
                              SourceUnit owner)
        Creates a new warning message.
        Parameters:
        importance - the warning level
        message - the message text
        data - additional data needed when generating the message
        context - context information for locating the offending source text
    • Method Detail

      • isRelevant

        public static boolean isRelevant​(int actual,
                                         int limit)
        Returns true if a warning would be relevant to the specified level.
      • isRelevant

        public boolean isRelevant​(int importance)
        Returns true if this message is as or more important than the specified importance level.
      • write

        public void write​(java.io.PrintWriter writer,
                          Janitor janitor)
        Description copied from class: Message
        Writes the message to the specified PrintWriter. The supplied ProcessingUnit is the unit that holds this Message.
        Overrides:
        write in class LocatedMessage