public final class TestResourceRepository extends AbstractResourceRepository implements SingleNamespaceResourceRepository
ResourceMerger emits.| Constructor and Description |
|---|
TestResourceRepository(com.android.ide.common.rendering.api.ResourceNamespace namespace) |
| Modifier and Type | Method and Description |
|---|---|
ResourceVisitor.VisitResult |
accept(ResourceVisitor visitor)
Calls the
ResourceVisitor.visit(ResourceItem) method for all resources in the
repository. |
ResourceTable |
getFullTable() |
com.android.ide.common.rendering.api.ResourceNamespace |
getNamespace()
The namespace that all items in this repository belong to.
|
java.lang.String |
getPackageName()
The package name from the manifest corresponding to this repository.
|
java.util.Collection<ResourceItem> |
getPublicResources(com.android.ide.common.rendering.api.ResourceNamespace namespace,
com.android.resources.ResourceType type)
Returns a collection of public resource items with the given namespace and type.
|
protected com.google.common.collect.ListMultimap<java.lang.String,ResourceItem> |
getResourcesInternal(com.android.ide.common.rendering.api.ResourceNamespace namespace,
com.android.resources.ResourceType resourceType)
Returns the
ListMultimap containing resources with the given namespace and type keyed
by resource names. |
void |
update(ResourceMerger merger) |
acceptByResources, getResources, getResources, getResources, getResourceTypes, hasResources, hasResourcesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLeafResourceRepositories, getNamespacesgetAllResources, getResources, getResources, getResources, getResources, getResourceTypes, hasResources, hasResourcespublic TestResourceRepository(@NonNull
com.android.ide.common.rendering.api.ResourceNamespace namespace)
@NonNull protected com.google.common.collect.ListMultimap<java.lang.String,ResourceItem> getResourcesInternal(@NonNull com.android.ide.common.rendering.api.ResourceNamespace namespace, @NonNull com.android.resources.ResourceType resourceType)
AbstractResourceRepositoryListMultimap containing resources with the given namespace and type keyed
by resource names. Unlike AbstractResourceRepository.getResources(ResourceNamespace, ResourceType), this method
is expected to return the map directly backed by the internal resource storage, although
the returned map doesn't have to be mutable.getResourcesInternal in class AbstractResourceRepositorynamespace - the namespace of the resources to returnresourceType - the type of the resources to return@NonNull public ResourceVisitor.VisitResult accept(@NonNull ResourceVisitor visitor)
ResourceRepositoryResourceVisitor.visit(ResourceItem) method for all resources in the
repository. The visitor should not perform any long running operations or operations
involving locks.accept in interface ResourceRepositoryvisitor - the visitor objectResourceVisitor.VisitResult.ABORT if the method finished because the visitor requested
it or ResourceVisitor.VisitResult.CONTINUE otherwise.@NonNull public com.android.ide.common.rendering.api.ResourceNamespace getNamespace()
SingleNamespaceResourceRepositoryResourceNamespace.RES_AUTO in non-namespaced projects or the namespace corresponding to the
package name returned by SingleNamespaceResourceRepository.getPackageName() in namespaced projects.getNamespace in interface SingleNamespaceResourceRepository@Nullable public java.lang.String getPackageName()
SingleNamespaceResourceRepositoryWhen the project is namespaced, this corresponds to the namespace returned by
SingleNamespaceResourceRepository.getNamespace(). In a non-namespaced project, the namespace is
ResourceNamespace.RES_AUTO but the value returned from this method can be used when
automatically migrating a project to use namespaces.
getPackageName in interface SingleNamespaceResourceRepository@NonNull public java.util.Collection<ResourceItem> getPublicResources(@NonNull com.android.ide.common.rendering.api.ResourceNamespace namespace, @NonNull com.android.resources.ResourceType type)
ResourceRepositorygetPublicResources in interface ResourceRepositorynamespace - the namespace of the resources to returntype - the type of the resources to return@NonNull public ResourceTable getFullTable()
public void update(@NonNull
ResourceMerger merger)