com.android.tools.lint.checks
Class IncludeDetector

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.IncludeDetector
All Implemented Interfaces:
com.android.tools.lint.detector.api.Detector.XmlScanner

public class IncludeDetector
extends com.android.tools.lint.detector.api.LayoutDetector

Checks for problems with include tags, such as providing layout parameters without specifying both layout_width and layout_height


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 ISSUE
          The main issue discovered by this detector
 
Fields inherited from interface com.android.tools.lint.detector.api.Detector.XmlScanner
ALL
 
Constructor Summary
IncludeDetector()
           
 
Method Summary
 java.util.Collection<java.lang.String> getApplicableElements()
           
static boolean requestsHeight(java.lang.String errorMessage)
          Returns true if the error message (earlier reported by this lint detector) requests for the layout_height to be defined.
static boolean requestsWidth(java.lang.String errorMessage)
          Returns true if the error message (earlier reported by this lint detector) requests for the layout_width to be defined.
 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
appliesTo, 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, afterCheckProject, applicableSuperClasses, appliesToFolder, appliesToResourceRefs, beforeCheckFile, beforeCheckLibraryProject, beforeCheckProject, checkBinaryResource, checkCall, checkClass, checkClass, checkFolder, checkInstruction, createJavaVisitor, getApplicableAsmNodeTypes, getApplicableAttributes, getApplicableCallNames, getApplicableCallOwners, getApplicableFiles, getApplicableMethodNames, getApplicableNodeTypes, getSpeed, 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

ISSUE

public static final com.android.tools.lint.detector.api.Issue ISSUE
The main issue discovered by this detector

Constructor Detail

IncludeDetector

public IncludeDetector()
Method Detail

getApplicableElements

@Nullable
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

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

requestsWidth

public static boolean requestsWidth(@NonNull
                                    java.lang.String errorMessage)
Returns true if the error message (earlier reported by this lint detector) requests for the layout_width to be defined.

Intended for IDE quickfix implementations.

Parameters:
errorMessage - the error message computed by lint
Returns:
true if the layout_width needs to be defined

requestsHeight

public static boolean requestsHeight(@NonNull
                                     java.lang.String errorMessage)
Returns true if the error message (earlier reported by this lint detector) requests for the layout_height to be defined.

Intended for IDE quickfix implementations.

Parameters:
errorMessage - the error message computed by lint
Returns:
true if the layout_height needs to be defined