com.android.ide.common.resources
Class ResourceFile

java.lang.Object
  extended by com.android.ide.common.resources.ResourceFile
All Implemented Interfaces:
Configurable
Direct Known Subclasses:
IdGeneratingResourceFile, MultiResourceFile, SingleResourceFile

public abstract class ResourceFile
extends java.lang.Object
implements Configurable

Represents a Resource file (a file under $Project/res/)


Constructor Summary
protected ResourceFile(com.android.io.IAbstractFile file, ResourceFolder folder)
           
 
Method Summary
protected abstract  void dispose(ScanningContext context)
           
 FolderConfiguration getConfiguration()
          Returns the FolderConfiguration for this object.
 com.android.io.IAbstractFile getFile()
          Returns the IFile associated with the ResourceFile.
 ResourceFolder getFolder()
          Returns the parent folder as a ResourceFolder.
 ResourceRepository getRepository()
           
abstract  java.util.Collection<com.android.resources.ResourceType> getResourceTypes()
          Returns the list of ResourceType generated by the file.
abstract  com.android.ide.common.rendering.api.ResourceValue getValue(com.android.resources.ResourceType type, java.lang.String name)
          Returns the value of a resource generated by this file by ResourceType and name.
abstract  boolean hasResources(com.android.resources.ResourceType type)
          Returns whether the file generated a resource of a specific type.
 boolean isFramework()
          Returns whether the resource is a framework resource.
protected abstract  void load(ScanningContext context)
           
 java.lang.String toString()
           
protected abstract  void update(ScanningContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceFile

protected ResourceFile(com.android.io.IAbstractFile file,
                       ResourceFolder folder)
Method Detail

load

protected abstract void load(ScanningContext context)

update

protected abstract void update(ScanningContext context)

dispose

protected abstract void dispose(ScanningContext context)

getConfiguration

public FolderConfiguration getConfiguration()
Description copied from interface: Configurable
Returns the FolderConfiguration for this object.

Specified by:
getConfiguration in interface Configurable

getFile

public final com.android.io.IAbstractFile getFile()
Returns the IFile associated with the ResourceFile.


getFolder

public final ResourceFolder getFolder()
Returns the parent folder as a ResourceFolder.


getRepository

public final ResourceRepository getRepository()

isFramework

public final boolean isFramework()
Returns whether the resource is a framework resource.


getResourceTypes

public abstract java.util.Collection<com.android.resources.ResourceType> getResourceTypes()
Returns the list of ResourceType generated by the file. This is never null.


hasResources

public abstract boolean hasResources(com.android.resources.ResourceType type)
Returns whether the file generated a resource of a specific type.

Parameters:
type - The ResourceType

getValue

public abstract com.android.ide.common.rendering.api.ResourceValue getValue(com.android.resources.ResourceType type,
                                                                            java.lang.String name)
Returns the value of a resource generated by this file by ResourceType and name.

If no resource match, null is returned.

Parameters:
type - the type of the resource.
name - the name of the resource.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object