public class AppLinksValidDetector
extends com.android.tools.lint.detector.api.Detector
implements com.android.tools.lint.detector.api.XmlScanner
| Modifier and Type | Class and Description |
|---|---|
static class |
AppLinksValidDetector.UriInfo
URL information from an intent filter
|
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.OtherFileScanner, com.android.tools.lint.detector.api.Detector.ResourceFolderScanner, com.android.tools.lint.detector.api.Detector.UastScanner, com.android.tools.lint.detector.api.Detector.XmlScanner| Modifier and Type | Field and Description |
|---|---|
static com.android.tools.lint.detector.api.Issue |
TEST_URL
The main issue discovered by this detector
|
static com.android.tools.lint.detector.api.Issue |
VALIDATION |
| Constructor and Description |
|---|
AppLinksValidDetector()
Constructs a new
AppLinksValidDetector check |
| Modifier and Type | Method and Description |
|---|---|
static java.util.List<AppLinksValidDetector.UriInfo> |
createUriInfos(org.w3c.dom.Element activity,
com.android.tools.lint.detector.api.XmlContext context)
Given an activity (or activity alias) element, looks up the intent filters
that contain URIs and creates a list of
AppLinksValidDetector.UriInfo objects for these |
java.util.Collection<java.lang.String> |
getApplicableElements() |
static java.lang.String |
testElement(java.net.URL testUrl,
java.util.List<AppLinksValidDetector.UriInfo> infos)
Given a test URL and a list of URI infos (previously returned from
createUriInfos(Element, XmlContext)) this method checks whether
the URL matches, and if so returns null, otherwise returning the reason
for the mismatch. |
void |
visitElement(com.android.tools.lint.detector.api.XmlContext context,
org.w3c.dom.Element activity) |
afterCheckFile, afterCheckLibraryProject, afterCheckProject, analyzeCallGraph, applicableAnnotations, applicableSuperClasses, appliesTo, appliesTo, appliesToResourceRefs, beforeCheckFile, beforeCheckLibraryProject, beforeCheckProject, checkBinaryResource, checkCall, checkClass, checkClass, checkFolder, checkInstruction, createPsiVisitor, createUastHandler, fix, getApplicableAsmNodeTypes, getApplicableAttributes, getApplicableCallNames, getApplicableCallOwners, getApplicableConstructorTypes, getApplicableFiles, getApplicableMethodNames, getApplicablePsiTypes, getApplicableReferenceNames, getApplicableUastTypes, getSpeed, isApplicableAnnotationUsage, isCallGraphRequired, run, visitAnnotationUsage, visitAttribute, visitBuildScript, visitClass, visitClass, visitConstructor, visitConstructor, visitDocument, visitElementAfter, visitMethod, visitMethod, visitReference, visitReference, visitResourceReference, visitResourceReferenceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final com.android.tools.lint.detector.api.Issue TEST_URL
public static final com.android.tools.lint.detector.api.Issue VALIDATION
public AppLinksValidDetector()
AppLinksValidDetector checkpublic java.util.Collection<java.lang.String> getApplicableElements()
getApplicableElements in interface com.android.tools.lint.detector.api.XmlScannergetApplicableElements in class com.android.tools.lint.detector.api.Detectorpublic void visitElement(@NonNull
com.android.tools.lint.detector.api.XmlContext context,
@NonNull
org.w3c.dom.Element activity)
visitElement in interface com.android.tools.lint.detector.api.XmlScannervisitElement in class com.android.tools.lint.detector.api.Detector@NonNull public static java.util.List<AppLinksValidDetector.UriInfo> createUriInfos(@NonNull org.w3c.dom.Element activity, @Nullable com.android.tools.lint.detector.api.XmlContext context)
AppLinksValidDetector.UriInfo objects for theseactivity - the activitycontext - an optional lint context to pass in; if provided,
lint will validate the activity attributes and report link-related
problems (such as unknown scheme, wrong port number etc)@Nullable
public static java.lang.String testElement(@NonNull
java.net.URL testUrl,
@NonNull
java.util.List<AppLinksValidDetector.UriInfo> infos)
createUriInfos(Element, XmlContext)) this method checks whether
the URL matches, and if so returns null, otherwise returning the reason
for the mismatch.testUrl - the URL to testinfos - the URL information