public static class LintFix.ReplaceString extends LintFix
This class/API is only intended for IDE use. Lint checks should be
accessing the builder class instead - LintFix.create().
LintFix.Builder, LintFix.DataMap, LintFix.FixMapBuilder, LintFix.GroupBuilder, LintFix.GroupType, LintFix.LintFixGroup, LintFix.ReplaceString, LintFix.ReplaceStringBuilder, LintFix.SetAttribute, LintFix.SetAttributeBuilder| Modifier and Type | Field and Description |
|---|---|
java.lang.String |
oldPattern
The regex to replace.
|
java.lang.String |
oldString
The string literal to replace.
|
com.android.tools.lint.detector.api.Location |
range
A location range to use for searching for the text or pattern.
|
boolean |
reformat
Whether the modified text range should be reformatted
|
java.lang.String |
replacement
The replacement string.
|
boolean |
shortenNames
Whether symbols should be shortened after replacement
|
displayName| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
expandBackReferences(java.util.regex.Matcher matcher)
If this LintFix.ReplaceString specified a regular expression in
oldPattern, and the replacement string replacement
specifies one or more "back references" (with (?<name>) with the syntax
\k<name> then this method will substitute in the matching
group. |
static java.lang.String |
expandBackReferences(java.lang.String replacement,
java.util.regex.Matcher matcher)
Given a matched regular expression and a back reference expression,
this method produces the expression with back references substituted in.
|
java.lang.String |
getDisplayName()
Return display name
|
@Nullable public final java.lang.String oldString
@Nullable public final java.lang.String oldPattern
@NonNull public final java.lang.String replacement
@Nullable public final com.android.tools.lint.detector.api.Location range
public final boolean shortenNames
public final boolean reformat
@NonNull public java.lang.String getDisplayName()
getDisplayName in class LintFixpublic java.lang.String expandBackReferences(@NonNull
java.util.regex.Matcher matcher)
oldPattern, and the replacement string replacement
specifies one or more "back references" (with (?<name>) with the syntax
\k<name> then this method will substitute in the matching
group. Note that "target" is a reserved name, used to identify the range
that should be completed.public static java.lang.String expandBackReferences(@NonNull
java.lang.String replacement,
@NonNull
java.util.regex.Matcher matcher)