com.android.ide.common.resources
Class InlineResourceItem

java.lang.Object
  extended by com.android.ide.common.resources.ResourceItem
      extended by com.android.ide.common.resources.InlineResourceItem
All Implemented Interfaces:
java.lang.Comparable<ResourceItem>

public class InlineResourceItem
extends ResourceItem

Represents a resource item that has been declared inline in another resource file. This covers the typical ID declaration of "@+id/foo", but does not cover normal value resources declared in strings.xml or other similar value files. This resource will return true for isDeclaredInline() and false for isEditableDirectly().


Constructor Summary
InlineResourceItem(java.lang.String name)
          Constructs a new inline ResourceItem.
 
Method Summary
 com.android.ide.common.rendering.api.ResourceValue getResourceValue(com.android.resources.ResourceType type, FolderConfiguration referenceConfig, boolean isFramework)
          Returns a ResourceValue for this item based on the given configuration.
 boolean isDeclaredInline()
          Returns whether the ID resource has been declared inline inside another resource XML file.
 boolean isEditableDirectly()
          Returns whether the resource is editable directly.
 java.lang.String toString()
           
 
Methods inherited from class com.android.ide.common.resources.ResourceItem
add, compareTo, getAlternateCount, getName, getSourceFileArray, getSourceFileList, getXmlString, hasAlternates, hasDefault, hasNoSourceFile, removeFile, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InlineResourceItem

public InlineResourceItem(java.lang.String name)
Constructs a new inline ResourceItem.

Parameters:
name - the name of the resource as it appears in the XML and R.java files.
Method Detail

isDeclaredInline

public boolean isDeclaredInline()
Description copied from class: ResourceItem
Returns whether the ID resource has been declared inline inside another resource XML file. If the resource type is not ResourceType.ID, this will always return false.

Overrides:
isDeclaredInline in class ResourceItem

isEditableDirectly

public boolean isEditableDirectly()
Description copied from class: ResourceItem
Returns whether the resource is editable directly.

This is typically the case for resources that don't have alternate versions, or resources of type ResourceType.ID that aren't declared inline.

Overrides:
isEditableDirectly in class ResourceItem

getResourceValue

public com.android.ide.common.rendering.api.ResourceValue getResourceValue(com.android.resources.ResourceType type,
                                                                           FolderConfiguration referenceConfig,
                                                                           boolean isFramework)
Description copied from class: ResourceItem
Returns a ResourceValue for this item based on the given configuration. If the ResourceItem has several source files, one will be selected based on the config.

Overrides:
getResourceValue in class ResourceItem
Parameters:
type - the type of the resource. This is necessary because ResourceItem doesn't embed its type, but ResourceValue does.
referenceConfig - the config of the resource item.
isFramework - whether the resource is a framework value. Same as the type.
Returns:
a ResourceValue or null if none match the config.

toString

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