com.android.ide.common.resources
Class SingleResourceFile
java.lang.Object
com.android.ide.common.resources.ResourceFile
com.android.ide.common.resources.SingleResourceFile
- All Implemented Interfaces:
- Configurable
public class SingleResourceFile
- extends ResourceFile
Represents a resource file describing a single resource.
This is typically an XML file inside res/anim, res/layout, or res/menu or an image file
under res/drawable.
Method Summary |
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. |
protected void |
load(ScanningContext context)
|
protected void |
update(ScanningContext context)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SingleResourceFile
public SingleResourceFile(com.android.io.IAbstractFile file,
ResourceFolder folder)
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.