com.android.tools.lint.checks
Class MissingClassDetector

java.lang.Object
  extended by com.android.tools.lint.detector.api.Detector
      extended by com.android.tools.lint.detector.api.ResourceXmlDetector
          extended by com.android.tools.lint.detector.api.LayoutDetector
              extended by com.android.tools.lint.checks.MissingClassDetector
All Implemented Interfaces:
com.android.tools.lint.detector.api.Detector.ClassScanner, com.android.tools.lint.detector.api.Detector.XmlScanner

public class MissingClassDetector
extends com.android.tools.lint.detector.api.LayoutDetector
implements com.android.tools.lint.detector.api.Detector.ClassScanner

Checks to ensure that classes referenced in the manifest actually exist and are included


Nested Class Summary
 
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 INNERCLASS
          Is the right character used for inner class separators?
static com.android.tools.lint.detector.api.Issue INSTANTIATABLE
          Are activity, service, receiver etc subclasses instantiatable?
static com.android.tools.lint.detector.api.Issue MISSING
          Manifest-referenced classes missing from the project or libraries
 
Fields inherited from interface com.android.tools.lint.detector.api.Detector.XmlScanner
ALL
 
Constructor Summary
MissingClassDetector()
          Constructs a new MissingClassDetector
 
Method Summary
 void afterCheckProject(com.android.tools.lint.detector.api.Context context)
           
 boolean appliesTo(com.android.resources.ResourceFolderType folderType)
           
 void checkClass(com.android.tools.lint.detector.api.ClassContext context, org.objectweb.asm.tree.ClassNode classNode)
           
 java.util.Collection<java.lang.String> getApplicableElements()
           
static java.lang.String getNewValue(com.android.tools.lint.detector.api.Issue issue, java.lang.String errorMessage, com.android.tools.lint.detector.api.TextFormat format)
          Given an error message produced by this lint detector for the given issue type, returns the new value to be put into the source code.
static java.lang.String getOldValue(com.android.tools.lint.detector.api.Issue issue, java.lang.String errorMessage, com.android.tools.lint.detector.api.TextFormat format)
          Given an error message produced by this lint detector for the given issue type, returns the old value to be replaced in the source code.
 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.LayoutDetector
hasPadding, isHeightFillParent, isWidthFillParent
 
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, applicableSuperClasses, appliesToFolder, appliesToResourceRefs, beforeCheckFile, beforeCheckLibraryProject, beforeCheckProject, checkBinaryResource, checkCall, checkClass, checkFolder, checkInstruction, createJavaVisitor, getApplicableAsmNodeTypes, getApplicableAttributes, getApplicableCallNames, getApplicableCallOwners, getApplicableConstructorTypes, getApplicableFiles, getApplicableMethodNames, getApplicableNodeTypes, getSpeed, visitAttribute, visitBuildScript, visitConstructor, 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.ClassScanner
checkCall, checkInstruction, getApplicableAsmNodeTypes, getApplicableCallNames, getApplicableCallOwners
 
Methods inherited from interface com.android.tools.lint.detector.api.Detector.XmlScanner
getApplicableAttributes, visitAttribute, visitDocument, visitElementAfter
 

Field Detail

MISSING

public static final com.android.tools.lint.detector.api.Issue MISSING
Manifest-referenced classes missing from the project or libraries


INSTANTIATABLE

public static final com.android.tools.lint.detector.api.Issue INSTANTIATABLE
Are activity, service, receiver etc subclasses instantiatable?


INNERCLASS

public static final com.android.tools.lint.detector.api.Issue INNERCLASS
Is the right character used for inner class separators?

Constructor Detail

MissingClassDetector

public MissingClassDetector()
Constructs a new MissingClassDetector

Method Detail

getSpeed

@NonNull
public com.android.tools.lint.detector.api.Speed getSpeed()
Overrides:
getSpeed in class com.android.tools.lint.detector.api.Detector

getApplicableElements

public java.util.Collection<java.lang.String> getApplicableElements()
Specified by:
getApplicableElements in interface com.android.tools.lint.detector.api.Detector.XmlScanner
Overrides:
getApplicableElements in class com.android.tools.lint.detector.api.Detector

appliesTo

public boolean appliesTo(@NonNull
                         com.android.resources.ResourceFolderType folderType)
Overrides:
appliesTo in class com.android.tools.lint.detector.api.LayoutDetector

visitElement

public void visitElement(@NonNull
                         com.android.tools.lint.detector.api.XmlContext context,
                         @NonNull
                         org.w3c.dom.Element element)
Specified by:
visitElement in interface com.android.tools.lint.detector.api.Detector.XmlScanner
Overrides:
visitElement in class com.android.tools.lint.detector.api.Detector

afterCheckProject

public void afterCheckProject(@NonNull
                              com.android.tools.lint.detector.api.Context context)
Overrides:
afterCheckProject in class com.android.tools.lint.detector.api.Detector

checkClass

public void checkClass(@NonNull
                       com.android.tools.lint.detector.api.ClassContext context,
                       @NonNull
                       org.objectweb.asm.tree.ClassNode classNode)
Specified by:
checkClass in interface com.android.tools.lint.detector.api.Detector.ClassScanner
Overrides:
checkClass in class com.android.tools.lint.detector.api.Detector

getOldValue

@Nullable
public static java.lang.String getOldValue(@NonNull
                                                    com.android.tools.lint.detector.api.Issue issue,
                                                    @NonNull
                                                    java.lang.String errorMessage,
                                                    @NonNull
                                                    com.android.tools.lint.detector.api.TextFormat format)
Given an error message produced by this lint detector for the given issue type, returns the old value to be replaced in the source code.

Intended for IDE quickfix implementations.

Parameters:
issue - the corresponding issue
errorMessage - the error message associated with the error
format - the format of the error message
Returns:
the corresponding old value, or null if not recognized

getNewValue

@Nullable
public static java.lang.String getNewValue(@NonNull
                                                    com.android.tools.lint.detector.api.Issue issue,
                                                    @NonNull
                                                    java.lang.String errorMessage,
                                                    @NonNull
                                                    com.android.tools.lint.detector.api.TextFormat format)
Given an error message produced by this lint detector for the given issue type, returns the new value to be put into the source code.

Intended for IDE quickfix implementations.

Parameters:
issue - the corresponding issue
errorMessage - the error message associated with the error
format - the format of the error message
Returns:
the corresponding new value, or null if not recognized