Class LayoutDetector

  extended by
      extended by
          extended by
All Implemented Interfaces:

public abstract class LayoutDetector
extends ResourceXmlDetector

Abstract class specifically intended for layout detectors which provides some common utility methods shared by layout detectors.

NOTE: This is not a public or final API; if you rely on this be prepared to adjust your code for the next tools release.

Nested Class Summary
Nested classes/interfaces inherited from class
Detector.BinaryResourceScanner, Detector.ClassScanner, Detector.GradleScanner, Detector.JavaScanner, Detector.OtherFileScanner, Detector.ResourceFolderScanner, Detector.XmlScanner
Field Summary
Fields inherited from interface
Constructor Summary
Method Summary
 boolean appliesTo( folderType)
          Returns whether this detector applies to the given folder type.
protected  boolean hasPadding(org.w3c.dom.Element root)
protected static boolean isHeightFillParent(org.w3c.dom.Element element)
protected static boolean isWidthFillParent(org.w3c.dom.Element element)
Methods inherited from class
appliesTo, run
Methods inherited from class
afterCheckFile, afterCheckLibraryProject, afterCheckProject, applicableSuperClasses, appliesToFolder, appliesToResourceRefs, beforeCheckFile, beforeCheckLibraryProject, beforeCheckProject, checkBinaryResource, checkCall, checkClass, checkClass, checkFolder, checkInstruction, createJavaVisitor, getApplicableAsmNodeTypes, getApplicableAttributes, getApplicableCallNames, getApplicableCallOwners, getApplicableConstructorTypes, getApplicableElements, getApplicableFiles, getApplicableMethodNames, getApplicableNodeTypes, getSpeed, getSpeed, visitAttribute, visitBuildScript, visitConstructor, visitDocument, visitElement, 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
getApplicableAttributes, getApplicableElements, visitAttribute, visitDocument, visitElement, visitElementAfter

Constructor Detail


public LayoutDetector()
Method Detail


public boolean appliesTo(@NonNull
Description copied from class: ResourceXmlDetector
Returns whether this detector applies to the given folder type. This allows the detectors to be pruned from iteration, so for example when we are analyzing a string value file we don't need to look up detectors related to layout.

appliesTo in class ResourceXmlDetector
folderType - the folder type to be visited
true if this detector can apply to resources in folders of the given type


protected static boolean isWidthFillParent(@NonNull
                                           org.w3c.dom.Element element)


protected static boolean isHeightFillParent(@NonNull
                                            org.w3c.dom.Element element)


protected boolean hasPadding(@NonNull
                             org.w3c.dom.Element root)