com.google.javascript.jscomp
Class DiagnosticType

java.lang.Object
  extended by 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:
Serialized Form

Field Summary
 CheckLevel defaultLevel
          Default level
 MessageFormat format
          The default way to format errors
 String key
          The error type.
 CheckLevel level
          Reporting level, initially the defaultLevel but may be changed.
 
Method Summary
 int compareTo(DiagnosticType diagnosticType)
           
static DiagnosticType disabled(String name, String descriptionFormat)
          Create a DiagnosticType at level CheckLevel.OFF
 boolean equals(Object type)
           
static DiagnosticType error(String name, String descriptionFormat)
          Create a DiagnosticType at level CheckLevel.ERROR
 int hashCode()
           
static DiagnosticType make(String name, CheckLevel level, String descriptionFormat)
          Create a DiagnosticType at a given CheckLevel.
 String toString()
           
static DiagnosticType warning(String name, 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 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 Detail

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