com.android.tools.lint.detector.api
Class ResourceXmlDetector
java.lang.Object
com.android.tools.lint.detector.api.Detector
com.android.tools.lint.detector.api.Detector.XmlDetectorAdapter
com.android.tools.lint.detector.api.ResourceXmlDetector
- All Implemented Interfaces:
- Detector.XmlScanner
- Direct Known Subclasses:
- LayoutDetector
public abstract class ResourceXmlDetector
- extends Detector.XmlDetectorAdapter
Specialized detector intended for XML resources. Detectors that apply to XML
resources should extend this detector instead since it provides special
iteration hooks that are more efficient.
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.
|
Method Summary |
boolean |
appliesTo(Context context,
File file)
Returns true if this detector applies to the given file |
boolean |
appliesTo(com.android.resources.ResourceFolderType folderType)
Returns whether this detector applies to the given folder type. |
void |
run(Context context)
Runs the detector |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResourceXmlDetector
public ResourceXmlDetector()
appliesTo
public boolean appliesTo(Context context,
File file)
- Description copied from class:
Detector
- Returns true if this detector applies to the given file
- Overrides:
appliesTo in class Detector.XmlDetectorAdapter
appliesTo
public boolean appliesTo(com.android.resources.ResourceFolderType folderType)
- 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.
- Parameters:
folderType - the folder type to be visited
- Returns:
- true if this detector can apply to resources in folders of the
given type
run
public void run(Context context)
- Description copied from class:
Detector
- Runs the detector
- Overrides:
run in class Detector.XmlDetectorAdapter
- Parameters:
context - the context describing the work to be done
Copyright © 2008-2012. All Rights Reserved.