Package com.google.javascript.jscomp
Class DiagnosticType
- java.lang.Object
-
- com.google.javascript.jscomp.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 leveljava.text.MessageFormat
format
The default way to format errorsjava.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.OFFboolean
equals(java.lang.Object type)
static DiagnosticType
error(java.lang.String name, java.lang.String descriptionFormat)
Create a DiagnosticType at level CheckLevel.ERRORint
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
-
-
-
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 identifierdescriptionFormat
- 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 identifierdescriptionFormat
- 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 identifierdescriptionFormat
- 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 identifierlevel
- Either CheckLevel.ERROR or CheckLevel.WARNINGdescriptionFormat
- A format string- Returns:
- A new DiagnosticType
-
equals
public boolean equals(java.lang.Object type)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
compareTo
public int compareTo(DiagnosticType diagnosticType)
- Specified by:
compareTo
in interfacejava.lang.Comparable<DiagnosticType>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-