public final class ResourceFolder extends java.lang.Object implements Configurable
ResourceFiles,
the FolderConfiguration, and a link to the IAbstractFolder object.| Modifier | Constructor and Description |
|---|---|
protected |
ResourceFolder(com.android.resources.ResourceFolderType type,
FolderConfiguration config,
com.android.io.IAbstractFolder folder,
ResourceRepository repository)
Creates a new
ResourceFolder |
| Modifier and Type | Method and Description |
|---|---|
void |
addFile(ResourceFile file)
Adds a
ResourceFile to the folder. |
protected void |
dispose(ScanningContext context) |
FolderConfiguration |
getConfiguration()
Returns the
FolderConfiguration for this object. |
ResourceFile |
getFile(java.lang.String filename)
Returns the
ResourceFile matching a given name. |
com.android.io.IAbstractFolder |
getFolder()
Returns the
IAbstractFolder associated with this object. |
ResourceRepository |
getRepository() |
java.util.Collection<com.android.resources.ResourceType> |
getResourceTypes()
Returns the list of
ResourceTypes generated by the files inside this folder. |
com.android.resources.ResourceFolderType |
getType()
Returns the
ResourceFolderType of this object. |
boolean |
hasFile(java.lang.String name)
Returns whether the folder contains a file with the given name.
|
boolean |
hasResources(com.android.resources.ResourceType type)
Returns whether a file in the folder is generating a resource of a specified type.
|
ResourceFile |
processFile(com.android.io.IAbstractFile file,
ResourceDeltaKind kind,
ScanningContext context)
Processes a file and adds it to its parent folder resource.
|
protected void |
removeFile(ResourceFile file,
ScanningContext context) |
java.lang.String |
toString() |
protected ResourceFolder(com.android.resources.ResourceFolderType type,
FolderConfiguration config,
com.android.io.IAbstractFolder folder,
ResourceRepository repository)
ResourceFoldertype - The type of the folderconfig - The configuration of the folderfolder - The associated IAbstractFolder object.repository - The associated ResourceRepositorypublic ResourceFile processFile(com.android.io.IAbstractFile file, ResourceDeltaKind kind, ScanningContext context)
file - the underlying resource file.kind - the file change kind.context - a context object with state for the current update, such
as a place to stash errors encounteredResourceFile that was created.public void addFile(ResourceFile file)
ResourceFile to the folder.file - The ResourceFile.protected void removeFile(ResourceFile file, ScanningContext context)
protected void dispose(ScanningContext context)
public com.android.io.IAbstractFolder getFolder()
IAbstractFolder associated with this object.public com.android.resources.ResourceFolderType getType()
ResourceFolderType of this object.public ResourceRepository getRepository()
public java.util.Collection<com.android.resources.ResourceType> getResourceTypes()
ResourceTypes generated by the files inside this folder.public FolderConfiguration getConfiguration()
ConfigurableFolderConfiguration for this object.getConfiguration in interface Configurablepublic boolean hasFile(java.lang.String name)
name - the name of the file.public ResourceFile getFile(java.lang.String filename)
ResourceFile matching a given name.filename - The name of the file to return.ResourceFile or null if no match was found.public boolean hasResources(com.android.resources.ResourceType type)
type - The ResourceType being looked up.public java.lang.String toString()
toString in class java.lang.Object