public static interface Detector.XmlScanner
| Modifier and Type | Field and Description |
|---|---|
static java.util.List<java.lang.String> |
ALL
Special marker collection returned by
getApplicableElements() or
getApplicableAttributes() to indicate that the check should be
invoked on all elements or all attributes |
| Modifier and Type | Method and Description |
|---|---|
java.util.Collection<java.lang.String> |
getApplicableAttributes()
Returns the list of attributes that this detector wants to analyze.
|
java.util.Collection<java.lang.String> |
getApplicableElements()
Returns the list of elements that this detector wants to analyze.
|
void |
visitAttribute(com.android.tools.lint.detector.api.XmlContext context,
org.w3c.dom.Attr attribute)
Visit the given attribute.
|
void |
visitDocument(com.android.tools.lint.detector.api.XmlContext context,
org.w3c.dom.Document document)
Visit the given document.
|
void |
visitElement(com.android.tools.lint.detector.api.XmlContext context,
org.w3c.dom.Element element)
Visit the given element.
|
void |
visitElementAfter(com.android.tools.lint.detector.api.XmlContext context,
org.w3c.dom.Element element)
Visit the given element after its children have been analyzed.
|
@NonNull static final java.util.List<java.lang.String> ALL
getApplicableElements() or
getApplicableAttributes() to indicate that the check should be
invoked on all elements or all attributesvoid visitDocument(@NonNull
com.android.tools.lint.detector.api.XmlContext context,
@NonNull
org.w3c.dom.Document document)
context - information about the document being analyzeddocument - the document to examinevoid visitElement(@NonNull
com.android.tools.lint.detector.api.XmlContext context,
@NonNull
org.w3c.dom.Element element)
context - information about the document being analyzedelement - the element to examinevoid visitElementAfter(@NonNull
com.android.tools.lint.detector.api.XmlContext context,
@NonNull
org.w3c.dom.Element element)
context - information about the document being analyzedelement - the element to examinevoid visitAttribute(@NonNull
com.android.tools.lint.detector.api.XmlContext context,
@NonNull
org.w3c.dom.Attr attribute)
context - information about the document being analyzedattribute - the attribute node to examine@Nullable java.util.Collection<java.lang.String> getApplicableElements()
visitElement(com.android.tools.lint.detector.api.XmlContext, org.w3c.dom.Element) method) for each matching element in the document.
If this method returns null, and getApplicableAttributes() also returns
null, then the visitDocument(com.android.tools.lint.detector.api.XmlContext, org.w3c.dom.Document) method will be called instead.
ALL marker to indicate that every single
element should be analyzed.@Nullable java.util.Collection<java.lang.String> getApplicableAttributes()
visitAttribute(com.android.tools.lint.detector.api.XmlContext, org.w3c.dom.Attr) method) for each matching attribute in the document.
If this method returns null, and getApplicableElements() also returns
null, then the visitDocument(com.android.tools.lint.detector.api.XmlContext, org.w3c.dom.Document) method will be called instead.
ALL marker to indicate that every single
attribute should be analyzed.