public class AnnotationDetector
extends com.android.tools.lint.detector.api.Detector
implements com.android.tools.lint.detector.api.Detector.JavaPsiScanner
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.JavaPsiScanner, 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| Modifier and Type | Field and Description |
|---|---|
static com.android.tools.lint.detector.api.Issue |
ANNOTATION_USAGE
Incorrectly using a support annotation
|
static com.android.tools.lint.detector.api.Issue |
FLAG_STYLE
Flags should typically be specified as bit shifts
|
static com.android.tools.lint.detector.api.Implementation |
IMPLEMENTATION |
static com.android.tools.lint.detector.api.Issue |
INSIDE_METHOD
Placing SuppressLint on a local variable doesn't work for class-file based checks
|
static com.android.tools.lint.detector.api.Issue |
SWITCH_TYPE_DEF
All IntDef constants should be included in switch
|
static com.android.tools.lint.detector.api.Issue |
UNIQUE
IntDef annotations should be unique
|
| Constructor and Description |
|---|
AnnotationDetector()
Constructs a new
AnnotationDetector check |
| Modifier and Type | Method and Description |
|---|---|
com.intellij.psi.JavaElementVisitor |
createPsiVisitor(com.android.tools.lint.detector.api.JavaContext context) |
java.util.List<java.lang.Class<? extends com.intellij.psi.PsiElement>> |
getApplicablePsiTypes() |
static java.util.List<java.lang.String> |
getMissingCases(java.lang.String errorMessage,
com.android.tools.lint.detector.api.TextFormat format)
Given an error message produced by this lint detector for the
SWITCH_TYPE_DEF issue
type, returns the list of missing enum cases. |
afterCheckFile, afterCheckLibraryProject, afterCheckProject, applicableSuperClasses, appliesTo, appliesTo, appliesToFolder, appliesToResourceRefs, beforeCheckFile, beforeCheckLibraryProject, beforeCheckProject, checkBinaryResource, checkCall, checkClass, checkClass, checkClass, checkFolder, checkInstruction, createJavaVisitor, getApplicableAsmNodeTypes, getApplicableAttributes, getApplicableCallNames, getApplicableCallOwners, getApplicableConstructorTypes, getApplicableElements, getApplicableFiles, getApplicableMethodNames, getApplicableNodeTypes, getApplicableReferenceNames, getSpeed, getSpeed, run, visitAttribute, visitBuildScript, visitConstructor, visitConstructor, visitDocument, visitElement, visitElementAfter, visitMethod, visitMethod, visitReference, visitResourceReference, visitResourceReferenceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplicableSuperClasses, appliesToResourceRefs, checkClass, getApplicableConstructorTypes, getApplicableMethodNames, getApplicableReferenceNames, visitConstructor, visitMethod, visitReference, visitResourceReferencepublic static final com.android.tools.lint.detector.api.Implementation IMPLEMENTATION
public static final com.android.tools.lint.detector.api.Issue INSIDE_METHOD
public static final com.android.tools.lint.detector.api.Issue ANNOTATION_USAGE
public static final com.android.tools.lint.detector.api.Issue UNIQUE
public static final com.android.tools.lint.detector.api.Issue FLAG_STYLE
public static final com.android.tools.lint.detector.api.Issue SWITCH_TYPE_DEF
public AnnotationDetector()
AnnotationDetector checkpublic java.util.List<java.lang.Class<? extends com.intellij.psi.PsiElement>> getApplicablePsiTypes()
getApplicablePsiTypes in interface com.android.tools.lint.detector.api.Detector.JavaPsiScannergetApplicablePsiTypes in class com.android.tools.lint.detector.api.Detector@Nullable
public com.intellij.psi.JavaElementVisitor createPsiVisitor(@NonNull
com.android.tools.lint.detector.api.JavaContext context)
createPsiVisitor in interface com.android.tools.lint.detector.api.Detector.JavaPsiScannercreatePsiVisitor in class com.android.tools.lint.detector.api.Detector@Nullable
public static java.util.List<java.lang.String> getMissingCases(@NonNull
java.lang.String errorMessage,
@NonNull
com.android.tools.lint.detector.api.TextFormat format)
SWITCH_TYPE_DEF issue
type, returns the list of missing enum cases. Intended for IDE quickfix implementations.
errorMessage - the error message associated with the errorformat - the format of the error message