Class DiagnosticType

java.lang.Object
com.google.javascript.jscomp.DiagnosticType
All Implemented Interfaces:
Serializable, Comparable<DiagnosticType>

public class DiagnosticType extends Object implements Comparable<DiagnosticType>, Serializable
The type of a compile or analysis error.
See Also:
  • Field Details

    • key

      public final String key
      The error type. Used as the BugPattern and BugInstance types by BugBot's XML
    • format

      public final MessageFormat format
      The default way to format errors
    • defaultLevel

      public final CheckLevel defaultLevel
      Default level
    • level

      public CheckLevel level
      Reporting level, initially the defaultLevel but may be changed.
  • Method Details

    • error

      public static DiagnosticType error(String name, String descriptionFormat)
      Create a DiagnosticType at level CheckLevel.ERROR
      Parameters:
      name - An identifier
      descriptionFormat - A format string
      Returns:
      A new DiagnosticType
    • warning

      public static DiagnosticType warning(String name, String descriptionFormat)
      Create a DiagnosticType at level CheckLevel.WARNING
      Parameters:
      name - An identifier
      descriptionFormat - A format string
      Returns:
      A new DiagnosticType
    • disabled

      public static DiagnosticType disabled(String name, String descriptionFormat)
      Create a DiagnosticType at level CheckLevel.OFF
      Parameters:
      name - An identifier
      descriptionFormat - A format string
      Returns:
      A new DiagnosticType
    • make

      public static DiagnosticType make(String name, CheckLevel level, String descriptionFormat)
      Create a DiagnosticType at a given CheckLevel.
      Parameters:
      name - An identifier
      level - Either CheckLevel.ERROR or CheckLevel.WARNING
      descriptionFormat - A format string
      Returns:
      A new DiagnosticType
    • equals

      public boolean equals(Object type)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(DiagnosticType diagnosticType)
      Specified by:
      compareTo in interface Comparable<DiagnosticType>
    • toString

      public String toString()
      Overrides:
      toString in class Object