com.android.ide.common.resources
Class IdGeneratingResourceFile

java.lang.Object
  extended by com.android.ide.common.resources.ResourceFile
      extended by com.android.ide.common.resources.IdGeneratingResourceFile
All Implemented Interfaces:
Configurable, ValueResourceParser.IValueResourceRepository

public final class IdGeneratingResourceFile
extends ResourceFile
implements ValueResourceParser.IValueResourceRepository

Represents a resource file that also generates ID resources.

This is typically an XML file in res/layout or res/menu


Constructor Summary
IdGeneratingResourceFile(com.android.io.IAbstractFile file, ResourceFolder folder, com.android.resources.ResourceType type)
           
 
Method Summary
 void addResourceValue(com.android.ide.common.rendering.api.ResourceValue value)
           
protected  void dispose(ScanningContext context)
           
 java.util.Collection<com.android.resources.ResourceType> getResourceTypes()
          Returns the list of ResourceType generated by the file.
 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.
 boolean hasResources(com.android.resources.ResourceType type)
          Returns whether the file generated a resource of a specific type.
 boolean hasResourceValue(com.android.resources.ResourceType type, java.lang.String name)
           
protected  void load(ScanningContext context)
           
protected  void update(ScanningContext context)
           
 
Methods inherited from class com.android.ide.common.resources.ResourceFile
getConfiguration, getFile, getFolder, getRepository, isFramework, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IdGeneratingResourceFile

public IdGeneratingResourceFile(com.android.io.IAbstractFile file,
                                ResourceFolder folder,
                                com.android.resources.ResourceType type)
Method Detail

load

protected void load(ScanningContext context)
Specified by:
load in class ResourceFile

update

protected void update(ScanningContext context)
Specified by:
update in class ResourceFile

dispose

protected void dispose(ScanningContext context)
Specified by:
dispose in class ResourceFile

getResourceTypes

public java.util.Collection<com.android.resources.ResourceType> getResourceTypes()
Description copied from class: ResourceFile
Returns the list of ResourceType generated by the file. This is never null.

Specified by:
getResourceTypes in class ResourceFile

hasResources

public boolean hasResources(com.android.resources.ResourceType type)
Description copied from class: ResourceFile
Returns whether the file generated a resource of a specific type.

Specified by:
hasResources in class ResourceFile
Parameters:
type - The ResourceType

getValue

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

If no resource match, null is returned.

Specified by:
getValue in class ResourceFile
Parameters:
type - the type of the resource.
name - the name of the resource.

addResourceValue

public void addResourceValue(com.android.ide.common.rendering.api.ResourceValue value)
Specified by:
addResourceValue in interface ValueResourceParser.IValueResourceRepository

hasResourceValue

public boolean hasResourceValue(com.android.resources.ResourceType type,
                                java.lang.String name)
Specified by:
hasResourceValue in interface ValueResourceParser.IValueResourceRepository