com.android.ide.common.repository
Class ResourceVisibilityLookup.Provider

java.lang.Object
  extended by com.android.ide.common.repository.ResourceVisibilityLookup.Provider
Enclosing class:
ResourceVisibilityLookup

public static class ResourceVisibilityLookup.Provider
extends java.lang.Object

Provider which keeps a set of ResourceVisibilityLookup instances around for repeated queries, including from different libraries that may share dependencies


Constructor Summary
ResourceVisibilityLookup.Provider()
           
 
Method Summary
 ResourceVisibilityLookup get(com.android.builder.model.AndroidArtifact artifact)
          Looks up a (possibly cached) ResourceVisibilityLookup for the given AndroidArtifact
 ResourceVisibilityLookup get(com.android.builder.model.AndroidLibrary library)
          Looks up a (possibly cached) ResourceVisibilityLookup for the given AndroidLibrary
 ResourceVisibilityLookup get(com.android.builder.model.AndroidProject project, com.android.builder.model.Variant variant)
          Looks up a (possibly cached) ResourceVisibilityLookup for the given AndroidArtifact
static boolean isVisibilityAwareModel(com.android.builder.model.AndroidProject project)
          Returns true if the given Gradle model is compatible with public resources.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceVisibilityLookup.Provider

public ResourceVisibilityLookup.Provider()
Method Detail

get

@NonNull
public ResourceVisibilityLookup get(@NonNull
                                            com.android.builder.model.AndroidLibrary library)
Looks up a (possibly cached) ResourceVisibilityLookup for the given AndroidLibrary

Parameters:
library - the library
Returns:
the corresponding ResourceVisibilityLookup

get

@NonNull
public ResourceVisibilityLookup get(@NonNull
                                            com.android.builder.model.AndroidArtifact artifact)
Looks up a (possibly cached) ResourceVisibilityLookup for the given AndroidArtifact

Parameters:
artifact - the artifact
Returns:
the corresponding ResourceVisibilityLookup

isVisibilityAwareModel

public static boolean isVisibilityAwareModel(@NonNull
                                             com.android.builder.model.AndroidProject project)
Returns true if the given Gradle model is compatible with public resources. (Older models than 1.3 will throw exceptions if we attempt to for example query the public resource file location.

Parameters:
project - the project to check
Returns:
true if the model is recent enough to support resource visibility queries

get

@NonNull
public ResourceVisibilityLookup get(@NonNull
                                            com.android.builder.model.AndroidProject project,
                                            @NonNull
                                            com.android.builder.model.Variant variant)
Looks up a (possibly cached) ResourceVisibilityLookup for the given AndroidArtifact

Parameters:
project - the project
Returns:
the corresponding ResourceVisibilityLookup