public class SingleResourceFile extends ResourceFile
This is typically an XML file inside res/anim, res/layout, or res/menu or an image file under res/drawable.
Constructor and Description |
---|
SingleResourceFile(com.android.io.IAbstractFile file,
ResourceFolder folder) |
Modifier and Type | Method and Description |
---|---|
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) |
getConfiguration, getFile, getFolder, getRepository, isFramework, toString
public SingleResourceFile(com.android.io.IAbstractFile file, ResourceFolder folder)
protected void load(ScanningContext context)
load
in class ResourceFile
protected void update(ScanningContext context)
update
in class ResourceFile
protected void dispose(ScanningContext context)
dispose
in class ResourceFile
public java.util.Collection<com.android.resources.ResourceType> getResourceTypes()
ResourceFile
ResourceType
generated by the file. This is never null.getResourceTypes
in class ResourceFile
public boolean hasResources(com.android.resources.ResourceType type)
ResourceFile
hasResources
in class ResourceFile
type
- The ResourceType
public com.android.ide.common.rendering.api.ResourceValue getValue(com.android.resources.ResourceType type, java.lang.String name)
ResourceFile
ResourceType
and name.
If no resource match, null
is returned.
getValue
in class ResourceFile
type
- the type of the resource.name
- the name of the resource.