|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.android.tools.lint.detector.api.Detector com.android.tools.lint.detector.api.ResourceXmlDetector com.android.tools.lint.checks.TypographyDetector
public class TypographyDetector
Checks for various typographical issues in string definitions.
Nested Class Summary | |
---|---|
static class |
TypographyDetector.ReplaceEdit
An object describing a single edit to be made. |
Nested classes/interfaces inherited from class com.android.tools.lint.detector.api.Detector |
---|
com.android.tools.lint.detector.api.Detector.BinaryResourceScanner, com.android.tools.lint.detector.api.Detector.ClassScanner, com.android.tools.lint.detector.api.Detector.GradleScanner, com.android.tools.lint.detector.api.Detector.JavaScanner, com.android.tools.lint.detector.api.Detector.OtherFileScanner, com.android.tools.lint.detector.api.Detector.ResourceFolderScanner, com.android.tools.lint.detector.api.Detector.XmlScanner |
Field Summary | |
---|---|
static com.android.tools.lint.detector.api.Issue |
DASHES
Replace hyphens with dashes? |
static com.android.tools.lint.detector.api.Issue |
ELLIPSIS
Replace ... |
static com.android.tools.lint.detector.api.Issue |
FRACTIONS
Replace fraction strings with fraction characters? |
static com.android.tools.lint.detector.api.Issue |
OTHER
The main issue discovered by this detector |
static com.android.tools.lint.detector.api.Issue |
QUOTES
Replace dumb quotes with smart quotes? |
Fields inherited from interface com.android.tools.lint.detector.api.Detector.XmlScanner |
---|
ALL |
Constructor Summary | |
---|---|
TypographyDetector()
Constructs a new TypographyDetector |
Method Summary | |
---|---|
boolean |
appliesTo(com.android.resources.ResourceFolderType folderType)
|
void |
beforeCheckProject(com.android.tools.lint.detector.api.Context context)
|
java.util.Collection<java.lang.String> |
getApplicableElements()
|
static java.util.List<TypographyDetector.ReplaceEdit> |
getEdits(java.lang.String issueId,
java.lang.String message,
org.w3c.dom.Node textNode)
Returns a list of edits to be applied to fix the suggestion made by the given warning. |
static java.util.List<TypographyDetector.ReplaceEdit> |
getEdits(java.lang.String issueId,
java.lang.String message,
java.lang.String text)
Returns a list of edits to be applied to fix the suggestion made by the given warning. |
com.android.tools.lint.detector.api.Speed |
getSpeed()
|
void |
visitElement(com.android.tools.lint.detector.api.XmlContext context,
org.w3c.dom.Element element)
|
Methods inherited from class com.android.tools.lint.detector.api.ResourceXmlDetector |
---|
appliesTo, run |
Methods inherited from class com.android.tools.lint.detector.api.Detector |
---|
afterCheckFile, afterCheckLibraryProject, afterCheckProject, applicableSuperClasses, appliesToFolder, appliesToResourceRefs, beforeCheckFile, beforeCheckLibraryProject, checkBinaryResource, checkCall, checkClass, checkClass, checkFolder, checkInstruction, createJavaVisitor, getApplicableAsmNodeTypes, getApplicableAttributes, getApplicableCallNames, getApplicableCallOwners, getApplicableFiles, getApplicableMethodNames, getApplicableNodeTypes, getSpeed, visitAttribute, visitBuildScript, visitDocument, visitElementAfter, visitMethod, visitResourceReference |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.android.tools.lint.detector.api.Detector.XmlScanner |
---|
getApplicableAttributes, visitAttribute, visitDocument, visitElementAfter |
Field Detail |
---|
public static final com.android.tools.lint.detector.api.Issue DASHES
public static final com.android.tools.lint.detector.api.Issue QUOTES
public static final com.android.tools.lint.detector.api.Issue FRACTIONS
public static final com.android.tools.lint.detector.api.Issue ELLIPSIS
public static final com.android.tools.lint.detector.api.Issue OTHER
Constructor Detail |
---|
public TypographyDetector()
TypographyDetector
Method Detail |
---|
public boolean appliesTo(@NonNull com.android.resources.ResourceFolderType folderType)
appliesTo
in class com.android.tools.lint.detector.api.ResourceXmlDetector
@NonNull public com.android.tools.lint.detector.api.Speed getSpeed()
getSpeed
in class com.android.tools.lint.detector.api.Detector
public java.util.Collection<java.lang.String> getApplicableElements()
getApplicableElements
in interface com.android.tools.lint.detector.api.Detector.XmlScanner
getApplicableElements
in class com.android.tools.lint.detector.api.Detector
public void beforeCheckProject(@NonNull com.android.tools.lint.detector.api.Context context)
beforeCheckProject
in class com.android.tools.lint.detector.api.Detector
public void visitElement(@NonNull com.android.tools.lint.detector.api.XmlContext context, @NonNull org.w3c.dom.Element element)
visitElement
in interface com.android.tools.lint.detector.api.Detector.XmlScanner
visitElement
in class com.android.tools.lint.detector.api.Detector
public static java.util.List<TypographyDetector.ReplaceEdit> getEdits(java.lang.String issueId, java.lang.String message, org.w3c.dom.Node textNode)
This is intended to help tools implement automatic fixes of these warnings. The reason only the message and issue id can be provided instead of actual state passed in the data field to a reporter is that fix operation can be run much later than the lint is processed (for example, in a subsequent run of the IDE when only the warnings have been persisted),
issueId
- the issue id, which should be the id for one of the
typography issuesmessage
- the actual error message, which should be a message
provided by this detectortextNode
- a text node which corresponds to the text node the
warning operated on
public static java.util.List<TypographyDetector.ReplaceEdit> getEdits(java.lang.String issueId, java.lang.String message, java.lang.String text)
This is intended to help tools implement automatic fixes of these warnings. The reason only the message and issue id can be provided instead of actual state passed in the data field to a reporter is that fix operation can be run much later than the lint is processed (for example, in a subsequent run of the IDE when only the warnings have been persisted),
issueId
- the issue id, which should be the id for one of the
typography issuesmessage
- the actual error message, which should be a message
provided by this detectortext
- the text of the XML node where the warning appeared
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |