public abstract class ResourceVisibilityLookup
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ResourceVisibilityLookup.Provider
Provider which keeps a set of
ResourceVisibilityLookup instances around for
repeated queries, including from different libraries that may share dependencies |
Modifier and Type | Field and Description |
---|---|
static ResourceVisibilityLookup |
NONE |
Constructor and Description |
---|
ResourceVisibilityLookup() |
Modifier and Type | Method and Description |
---|---|
static ResourceVisibilityLookup |
create(com.android.builder.model.AndroidLibrary library)
Creates a
ResourceVisibilityLookup for a given library. |
static ResourceVisibilityLookup |
create(java.util.List<com.android.builder.model.AndroidLibrary> libraries,
ResourceVisibilityLookup.Provider provider)
Creates a
ResourceVisibilityLookup for the set of libraries. |
abstract com.android.builder.model.AndroidLibrary |
getPrivateIn(com.android.resources.ResourceType type,
java.lang.String name)
For a private resource, return the
AndroidLibrary that the resource was defined as
private in |
abstract boolean |
isEmpty()
Returns true if this repository does not declare any resources to be private
|
abstract boolean |
isPrivate(com.android.resources.ResourceType type,
java.lang.String name)
Returns true if the given resource is private
|
boolean |
isPrivate(ResourceUrl url)
Returns true if the given resource is private
|
public static final ResourceVisibilityLookup NONE
public abstract boolean isPrivate(@NonNull com.android.resources.ResourceType type, @NonNull java.lang.String name)
type
- the type of the resourcename
- the resource field name of the resource (in other words, for
style Theme:Variant.Cls the name would be Theme_Variant_Clspublic boolean isPrivate(@NonNull ResourceUrl url)
url
- the resource URL@Nullable public abstract com.android.builder.model.AndroidLibrary getPrivateIn(@NonNull com.android.resources.ResourceType type, @NonNull java.lang.String name)
AndroidLibrary
that the resource was defined as
private intype
- the type of the resourcename
- the name of the resourcepublic abstract boolean isEmpty()
@NonNull public static ResourceVisibilityLookup create(@NonNull com.android.builder.model.AndroidLibrary library)
ResourceVisibilityLookup
for a given library.
NOTE: The ResourceVisibilityLookup.Provider
class can be used to share/cache ResourceVisibilityLookup
instances, e.g. when you have library1 and library2 each referencing libraryBase, the ResourceVisibilityLookup.Provider
will ensure that a the libraryBase data is shared.
library
- the libraryResourceVisibilityLookup
@NonNull public static ResourceVisibilityLookup create(@NonNull java.util.List<com.android.builder.model.AndroidLibrary> libraries, @Nullable ResourceVisibilityLookup.Provider provider)
ResourceVisibilityLookup
for the set of libraries.
NOTE: The ResourceVisibilityLookup.Provider
class can be used to share/cache ResourceVisibilityLookup
instances, e.g. when you have library1 and library2 each referencing libraryBase, the ResourceVisibilityLookup.Provider
will ensure that a the libraryBase data is shared.
libraries
- the list of librariesprovider
- an optional manager instance for caching of individual libraries, if anyResourceVisibilityLookup