|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.android.tools.lint.client.api.Configuration
@Beta public abstract class Configuration
Lint configuration for an Android project such as which specific rules to include, which specific rules to exclude, and which specific errors to ignore.
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.
Constructor Summary | |
---|---|
Configuration()
|
Method Summary | |
---|---|
void |
finishBulkEditing()
Marks the end of a "bulk" editing operation, where values should be committed to persistent storage. |
Severity |
getSeverity(Issue issue)
Returns the severity for a given issue. |
abstract void |
ignore(Context context,
Issue issue,
Location location,
java.lang.String message)
Marks the given warning as "ignored". |
boolean |
isEnabled(Issue issue)
Returns false if the given issue has been disabled. |
boolean |
isIgnored(Context context,
Issue issue,
Location location,
java.lang.String message)
Checks whether this issue should be ignored because the user has already suppressed the error? Note that this refers to individual issues being suppressed/ignored, not a whole detector being disabled via something like isEnabled(Issue) . |
abstract void |
setSeverity(Issue issue,
Severity severity)
Sets the severity to be used for this issue. |
void |
startBulkEditing()
Marks the beginning of a "bulk" editing operation with repeated calls to setSeverity(com.android.tools.lint.detector.api.Issue, com.android.tools.lint.detector.api.Severity) or ignore(com.android.tools.lint.detector.api.Context, com.android.tools.lint.detector.api.Issue, com.android.tools.lint.detector.api.Location, java.lang.String) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Configuration()
Method Detail |
---|
public boolean isIgnored(@NonNull Context context, @NonNull Issue issue, @Nullable Location location, @NonNull java.lang.String message)
isEnabled(Issue)
.
context
- the context used by the detector when the issue was foundissue
- the issue that was foundlocation
- the location of the issuemessage
- the associated user message
public boolean isEnabled(@NonNull Issue issue)
getSeverity(issue) != Severity.IGNORE
.
issue
- the issue to check
public Severity getSeverity(@NonNull Issue issue)
Issue.getDefaultSeverity()
unless the user has selected a custom
severity (which is tool context dependent).
issue
- the issue to look up the severity from
public abstract void ignore(@NonNull Context context, @NonNull Issue issue, @Nullable Location location, @NonNull java.lang.String message)
context
- The scanning contextissue
- the issue to be ignoredlocation
- The location to ignore the warning at, if anymessage
- The message for the warningpublic abstract void setSeverity(@NonNull Issue issue, @Nullable Severity severity)
issue
- the issue to set the severity forseverity
- the severity to associate with this issue, or null to
reset the severity to the defaultpublic void startBulkEditing()
setSeverity(com.android.tools.lint.detector.api.Issue, com.android.tools.lint.detector.api.Severity)
or ignore(com.android.tools.lint.detector.api.Context, com.android.tools.lint.detector.api.Issue, com.android.tools.lint.detector.api.Location, java.lang.String)
. After all the values have been
set, the client must call finishBulkEditing()
. This
allows configurations to avoid doing expensive I/O (such as writing out a
config XML file) for each and every editing operation when they are
applied in bulk, such as from a configuration dialog's "Apply" action.
public void finishBulkEditing()
startBulkEditing()
for
details.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |