public enum ResourceType extends java.lang.Enum<ResourceType>
See ResourceType in aapt2/Resource.h.
| Enum Constant and Description |
|---|
AAPT
This type is used for elements dynamically generated by the parsing of aapt:attr nodes.
|
ANIM |
ANIMATOR |
ARRAY |
ATTR |
BOOL |
COLOR |
DIMEN |
DRAWABLE |
FONT |
FRACTION |
ID |
INTEGER |
INTERPOLATOR |
LAYOUT |
MENU |
MIPMAP |
NAVIGATION |
PLURALS |
PUBLIC
This is not actually used.
|
RAW |
SAMPLE_DATA
Not an actual resource type from AAPT.
|
STRING |
STYLE |
STYLE_ITEM
Represents item tags inside a style definition.
|
STYLEABLE |
TRANSITION |
XML |
| Modifier and Type | Field and Description |
|---|---|
static com.google.common.collect.ImmutableSet<ResourceType> |
REFERENCEABLE_TYPES
The set of all types of resources that can be referenced by other resources.
|
| Modifier and Type | Method and Description |
|---|---|
static ResourceType |
fromClassName(java.lang.String className)
Returns the enum by its name as it appears in the R class.
|
static ResourceType |
fromFolderName(java.lang.String folderName)
Returns the enum by its name as it appears as a folder name under
res/. |
static ResourceType |
fromXmlTag(org.w3c.dom.Node domNode) |
static <T> ResourceType |
fromXmlTag(T tag,
java.util.function.Function<T,java.lang.String> nameFunction,
java.util.function.BiFunction<T,java.lang.String,java.lang.String> attributeFunction) |
static ResourceType |
fromXmlTagName(java.lang.String tagName)
Returns the enum by its name as it appears in XML as a tag name.
|
static ResourceType |
fromXmlValue(java.lang.String xmlValue)
Returns the enum by its name as it appears in a
ResourceUrl string. |
boolean |
getCanBeReferenced()
Returns true if this
ResourceType can be referenced using the ResourceUrl
syntax: @typeName/resourceName. |
java.lang.String |
getDisplayName()
Returns a translated display name for the resource type.
|
static ResourceType |
getEnum(java.lang.String className)
Deprecated.
Use other static methods in this class. Kept for layoutlib binary compatibility.
|
boolean |
getHasInnerClass()
Returns true if the generated R class contains an inner class for this
ResourceType. |
java.lang.String |
getName()
Returns the resource type name, as used by XML files.
|
java.lang.String |
toString() |
static ResourceType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ResourceType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ResourceType ANIM
public static final ResourceType ANIMATOR
public static final ResourceType ARRAY
public static final ResourceType ATTR
public static final ResourceType BOOL
public static final ResourceType COLOR
public static final ResourceType DIMEN
public static final ResourceType DRAWABLE
public static final ResourceType FONT
public static final ResourceType FRACTION
public static final ResourceType ID
public static final ResourceType INTEGER
public static final ResourceType INTERPOLATOR
public static final ResourceType LAYOUT
public static final ResourceType MENU
public static final ResourceType MIPMAP
public static final ResourceType NAVIGATION
public static final ResourceType PLURALS
public static final ResourceType RAW
public static final ResourceType STRING
public static final ResourceType STYLE
public static final ResourceType STYLEABLE
public static final ResourceType TRANSITION
public static final ResourceType XML
public static final ResourceType PUBLIC
public static final ResourceType AAPT
public static final ResourceType STYLE_ITEM
public static final ResourceType SAMPLE_DATA
public static final com.google.common.collect.ImmutableSet<ResourceType> REFERENCEABLE_TYPES
public static ResourceType[] values()
for (ResourceType c : ResourceType.values()) System.out.println(c);
public static ResourceType valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is null@NonNull public java.lang.String getName()
@NonNull public java.lang.String getDisplayName()
@Nullable public static ResourceType fromClassName(@NonNull java.lang.String className)
className - name of the inner class of the R class, e.g. "string" or "styleable".@Nullable public static ResourceType fromFolderName(@NonNull java.lang.String folderName)
res/.folderName - name of the inner class of the R class, e.g. "drawable" or "color".@Nullable public static ResourceType fromXmlTagName(@NonNull java.lang.String tagName)
tagName - name of the XML tag, e.g. "string" or "declare-styleable".@Nullable public static ResourceType fromXmlValue(@NonNull java.lang.String xmlValue)
ResourceUrl string.xmlValue - value of the type attribute or the prefix of a ResourceUrl, e.g.
"string" or "array".@Nullable public static <T> ResourceType fromXmlTag(@NonNull T tag, @NonNull java.util.function.Function<T,java.lang.String> nameFunction, @NonNull java.util.function.BiFunction<T,java.lang.String,java.lang.String> attributeFunction)
@Nullable public static ResourceType fromXmlTag(@NonNull org.w3c.dom.Node domNode)
@Deprecated public static ResourceType getEnum(@NonNull java.lang.String className)
public boolean getHasInnerClass()
ResourceType.public boolean getCanBeReferenced()
ResourceType can be referenced using the ResourceUrl
syntax: @typeName/resourceName.@NonNull public java.lang.String toString()
toString in class java.lang.Enum<ResourceType>