public class LintBaseline
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TAG_ISSUES
Root tag in baseline files (which can be the XML output report files from lint, or a
subset of these
|
Constructor and Description |
---|
LintBaseline(LintClient client,
java.io.File baselineFile) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Finishes writing the baseline
|
boolean |
findAndMark(Issue issue,
Location location,
java.lang.String message,
Severity severity,
Project project)
Checks whether the given warning (of the given issue type, message and location)
is present in this baseline, and if so marks it as used such that a second call will
not find it.
|
java.io.File |
getFile()
Returns the file which records the data in this baseline
|
int |
getFixedCount()
Returns the number of issues that appear to have been fixed (e.g.
|
int |
getFoundErrorCount()
Returns the number of errors that have been matched from the baseline
|
int |
getFoundWarningCount()
Returns the number of warnings that have been matched from the baseline
|
int |
getTotalCount()
Returns the total number of issues contained in this baseline
|
static boolean |
isFilteredMessage(java.lang.String errorMessage,
TextFormat format)
Given an error message produced by this lint detector for the given issue type,
determines whether this corresponds to the warning (produced by
{link
reportBaselineIssues(LintDriver, Project) above) that one or
more issues have been filtered out. |
static boolean |
isFixedMessage(java.lang.String errorMessage,
TextFormat format)
Given an error message produced by this lint detector for the given issue type,
determines whether this corresponds to the warning (produced by
{link
reportBaselineIssues(LintDriver, Project) above) that one or
more issues have been fixed (present in baseline but not in project.) |
boolean |
isRemoveFixed()
Whether the baseline when writing the file will skip fixed issues, or include all.
|
boolean |
isWriteOnClose()
Returns whether this baseline is writing its result upon close
|
void |
setRemoveFixed(boolean skipFixed)
Whether the baseline when writing the file should skip fixed issues, or include all.
|
void |
setWriteOnClose(boolean writeOnClose)
Sets whether the baseline should write its matched entries on
close() |
public static final java.lang.String TAG_ISSUES
public LintBaseline(@NonNull LintClient client, @NonNull java.io.File baselineFile)
public static boolean isFilteredMessage(@NonNull java.lang.String errorMessage, @NonNull TextFormat format)
reportBaselineIssues(LintDriver, Project)
above) that one or
more issues have been filtered out.
Intended for IDE quickfix implementations.
public static boolean isFixedMessage(@NonNull java.lang.String errorMessage, @NonNull TextFormat format)
reportBaselineIssues(LintDriver, Project)
above) that one or
more issues have been fixed (present in baseline but not in project.)
Intended for IDE quickfix implementations.
public boolean findAndMark(@NonNull Issue issue, @NonNull Location location, @NonNull java.lang.String message, @Nullable Severity severity, @Nullable Project project)
When issue analysis is done you can call getFoundErrorCount()
and
getFoundWarningCount()
to get a count of the warnings or errors that were
matched during the run, and getFixedCount()
to get a count of the issues
that were present in the baseline that were not matched (e.g. have been fixed.)
issue
- the issue typelocation
- the location of the errormessage
- the exact error message (in TextFormat.RAW
format)severity
- the severity of the issue, used to count baseline match as error or warningproject
- the relevant project, if anypublic int getFoundErrorCount()
public int getFoundWarningCount()
public int getFixedCount()
public int getTotalCount()
@NonNull public java.io.File getFile()
public boolean isWriteOnClose()
public void setWriteOnClose(boolean writeOnClose)
close()
public boolean isRemoveFixed()
public void setRemoveFixed(boolean skipFixed)
skipFixed
- true to skip fixed issuespublic void close()