|
|||||||||
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 com.android.tools.lint.client.api.DefaultConfiguration
@Beta public class DefaultConfiguration
Default implementation of a Configuration
which reads and writes
configuration data into lint.xml
in the project directory.
Field Summary | |
---|---|
static java.lang.String |
CONFIG_FILE_NAME
Default name of the configuration file |
Constructor Summary | |
---|---|
protected |
DefaultConfiguration(LintClient client,
Project project,
Configuration parent)
|
protected |
DefaultConfiguration(LintClient client,
Project project,
Configuration parent,
java.io.File configFile)
|
Method Summary | |
---|---|
static DefaultConfiguration |
create(LintClient client,
java.io.File lintFile)
Creates a new DefaultConfiguration for the given lint config
file, not affiliated with a project. |
static DefaultConfiguration |
create(LintClient client,
Project project,
Configuration parent)
Creates a new DefaultConfiguration |
void |
finishBulkEditing()
Marks the end of a "bulk" editing operation, where values should be committed to persistent storage. |
protected Severity |
getDefaultSeverity(Issue issue)
|
Severity |
getSeverity(Issue issue)
Returns the severity for a given issue. |
void |
ignore(Context context,
Issue issue,
Location location,
java.lang.String message,
java.lang.Object data)
Marks the given warning as "ignored". |
void |
ignore(Issue issue,
java.io.File file)
Marks the given issue and file combination as being ignored. |
boolean |
isIgnored(Context context,
Issue issue,
Location location,
java.lang.String message,
java.lang.Object data)
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 Configuration.isEnabled(Issue) . |
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 Configuration.setSeverity(com.android.tools.lint.detector.api.Issue, com.android.tools.lint.detector.api.Severity) or Configuration.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, java.lang.Object) . |
Methods inherited from class com.android.tools.lint.client.api.Configuration |
---|
isEnabled |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CONFIG_FILE_NAME
Constructor Detail |
---|
protected DefaultConfiguration(@NonNull LintClient client, @Nullable Project project, @Nullable Configuration parent, @NonNull java.io.File configFile)
protected DefaultConfiguration(@NonNull LintClient client, @NonNull Project project, @Nullable Configuration parent)
Method Detail |
---|
@NonNull public static DefaultConfiguration create(@NonNull LintClient client, @NonNull Project project, @Nullable Configuration parent)
DefaultConfiguration
client
- the client to report errors to etcproject
- the associated projectparent
- the parent/fallback configuration or null
@NonNull public static DefaultConfiguration create(@NonNull LintClient client, @NonNull java.io.File lintFile)
DefaultConfiguration
for the given lint config
file, not affiliated with a project. This is used for global
configurations.
client
- the client to report errors to etclintFile
- the lint file containing the configuration
public boolean isIgnored(@NonNull Context context, @NonNull Issue issue, @Nullable Location location, @NonNull java.lang.String message, @Nullable java.lang.Object data)
Configuration
Configuration.isEnabled(Issue)
.
isIgnored
in class Configuration
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 messagedata
- additional information about an issue (see
LintClient.report(Context, Issue, Severity, Location, String, Object)
for more information
@NonNull protected Severity getDefaultSeverity(@NonNull Issue issue)
@NonNull public Severity getSeverity(@NonNull Issue issue)
Configuration
Issue.getDefaultSeverity()
unless the user has selected a custom
severity (which is tool context dependent).
getSeverity
in class Configuration
issue
- the issue to look up the severity from
public void ignore(@NonNull Context context, @NonNull Issue issue, @Nullable Location location, @NonNull java.lang.String message, @Nullable java.lang.Object data)
Configuration
ignore
in class Configuration
context
- The scanning contextissue
- the issue to be ignoredlocation
- The location to ignore the warning at, if anymessage
- The message for the warningdata
- The corresponding data, or nullpublic void ignore(@NonNull Issue issue, @NonNull java.io.File file)
issue
- the issue to be ignored in the given filefile
- the file to ignore the issue inpublic void setSeverity(@NonNull Issue issue, @Nullable Severity severity)
Configuration
setSeverity
in class Configuration
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()
Configuration
Configuration.setSeverity(com.android.tools.lint.detector.api.Issue, com.android.tools.lint.detector.api.Severity)
or Configuration.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, java.lang.Object)
. After all the values have been
set, the client must call Configuration.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.
startBulkEditing
in class Configuration
public void finishBulkEditing()
Configuration
Configuration.startBulkEditing()
for
details.
finishBulkEditing
in class Configuration
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |