|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.android.tools.lint.detector.api.Issue
public final class Issue
An issue is a potential bug in an Android application. An issue is discovered
by a Detector, and has an associated Severity.
Issues and detectors are separate classes because a detector can discover multiple different issues as it's analyzing code, and we want to be able to different severities for different issues, the ability to suppress one but not other issues from the same detector, and so on.
NOTE: This is not a public or final API; if you rely on this be prepared to adjust your code for the next tools release.
| Method Summary | |
|---|---|
int |
compareTo(Issue other)
Sorts the detectors alphabetically by id. |
static Issue |
create(String id,
String description,
String explanation,
Category category,
int priority,
Severity severity,
Class<? extends Detector> detectorClass,
EnumSet<Scope> scope)
Creates a new issue |
Category |
getCategory()
The category, or null if no category has been assigned |
Severity |
getDefaultSeverity()
Returns the default severity of the issues found by this detector (some tools may allow the user to specify custom severities for detectors). |
String |
getDescription()
Briefly (one line) describes the kinds of checks performed by this rule |
Class<? extends Detector> |
getDetectorClass()
Returns the class of the detector to use to find this issue |
String |
getExplanation()
Describes the error found by this rule, e.g. |
String |
getId()
Returns the unique id of this issue. |
String |
getMoreInfo()
Returns a link (a URL string) to more information, or null |
int |
getPriority()
Returns a priority, in the range 1-10, with 10 being the most severe and 1 the least |
EnumSet<Scope> |
getScope()
Returns the scope required to analyze the code to detect this issue. |
boolean |
isEnabledByDefault()
Returns whether this issue should be enabled by default, unless the user has explicitly disabled it. |
Issue |
setEnabledByDefault(boolean enabledByDefault)
Sets whether this issue is enabled by default. |
Issue |
setMoreInfo(String moreInfoUrl)
Sets a more info URL string |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static Issue create(String id,
String description,
String explanation,
Category category,
int priority,
Severity severity,
Class<? extends Detector> detectorClass,
EnumSet<Scope> scope)
id - the fixed id of the issuedescription - the quick summary of the issue (one line)explanation - a full explanation of the issue, with suggestions for
how to fix itcategory - the associated category, if anypriority - the priority, a number from 1 to 10 with 10 being most
important/severeseverity - the default severity of the issuedetectorClass - the class of the detector to find this issuescope - the scope of files required to analyze this issue
Issuepublic String getId()
public String getDescription()
public String getExplanation()
getMoreInfo().
public Category getCategory()
public int getPriority()
public Severity getDefaultSeverity()
Note that even though the normal way for an issue to be disabled is for
the Configuration to return Severity.IGNORE, there is a
isEnabledByDefault() method which can be used to turn off issues
by default. This is done rather than just having the severity as the only
attribute on the issue such that an issue can be configured with an
appropriate severity (such as Severity.ERROR) even when issues
are disabled by default for example because they are experimental or not
yet stable.
public String getMoreInfo()
public boolean isEnabledByDefault()
public EnumSet<Scope> getScope()
public int compareTo(Issue other)
compareTo in interface Comparable<Issue>other - the Issue to compare this issue topublic Issue setMoreInfo(String moreInfoUrl)
moreInfoUrl - url string
public Issue setEnabledByDefault(boolean enabledByDefault)
enabledByDefault - whether the issue should be enabled by default
public Class<? extends Detector> getDetectorClass()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||