Class DiagnosticType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<DiagnosticType>

    public class DiagnosticType
    extends java.lang.Object
    implements java.lang.Comparable<DiagnosticType>, java.io.Serializable
    The type of a compile or analysis error.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      CheckLevel defaultLevel
      Default level
      java.text.MessageFormat format
      The default way to format errors
      java.lang.String key
      The error type.
      CheckLevel level
      Reporting level, initially the defaultLevel but may be changed.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(DiagnosticType diagnosticType)  
      static DiagnosticType disabled​(java.lang.String name, java.lang.String descriptionFormat)
      Create a DiagnosticType at level CheckLevel.OFF
      boolean equals​(java.lang.Object type)  
      static DiagnosticType error​(java.lang.String name, java.lang.String descriptionFormat)
      Create a DiagnosticType at level CheckLevel.ERROR
      int hashCode()  
      static DiagnosticType make​(java.lang.String name, CheckLevel level, java.lang.String descriptionFormat)
      Create a DiagnosticType at a given CheckLevel.
      java.lang.String toString()  
      static DiagnosticType warning​(java.lang.String name, java.lang.String descriptionFormat)
      Create a DiagnosticType at level CheckLevel.WARNING
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • key

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

        public final java.text.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 Detail

      • error

        public static DiagnosticType error​(java.lang.String name,
                                           java.lang.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​(java.lang.String name,
                                             java.lang.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​(java.lang.String name,
                                              java.lang.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​(java.lang.String name,
                                          CheckLevel level,
                                          java.lang.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​(java.lang.Object type)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object