public class AttrResourceValueImpl extends ResourceValueImpl implements AttrResourceValue
mNamespaceResolver| Constructor and Description |
|---|
AttrResourceValueImpl(ResourceNamespace namespace,
ResourceType type,
java.lang.String name,
java.lang.String libraryName) |
AttrResourceValueImpl(ResourceReference reference,
java.lang.String libraryName) |
| Modifier and Type | Method and Description |
|---|---|
void |
addValue(java.lang.String valueName,
java.lang.Integer numericValue,
java.lang.String description)
Adds a possible value of the flag or enum attribute.
|
java.util.Map<java.lang.String,java.lang.Integer> |
getAttributeValues()
Returns the enum or flag integer values keyed by the value names.
|
java.lang.String |
getDescription()
Returns the description of the attr resource obtained from an XML comment.
|
java.util.Set<AttributeFormat> |
getFormats()
Returns the formats allowed for the values of the attribute.
|
java.lang.String |
getGroupName()
Returns the name of the attr group obtained from an XML comment.
|
java.lang.String |
getValueDescription(java.lang.String valueName)
Returns the description of a enum/flag value with the given name.
|
void |
setDescription(java.lang.String description)
Sets the description of the attr resource.
|
void |
setFormats(java.util.Collection<AttributeFormat> formats)
Sets the formats allowed for the attribute.
|
void |
setGroupName(java.lang.String groupName)
Sets the name of group the attr resource belongs to.
|
asReference, equals, getLibraryName, getName, getNamespace, getNamespaceResolver, getResourceType, getValue, hashCode, isFramework, isUserDefined, replaceWith, setNamespaceResolver, setValue, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitasReference, getLibraryName, getName, getNamespace, getNamespaceResolver, getRawXmlValue, getReference, getResourceType, getResourceUrl, getValue, isFramework, isUserDefined, setNamespaceResolver, setValuepublic AttrResourceValueImpl(@NonNull
ResourceNamespace namespace,
@NonNull
ResourceType type,
@NonNull
java.lang.String name,
@Nullable
java.lang.String libraryName)
public AttrResourceValueImpl(@NonNull
ResourceReference reference,
@Nullable
java.lang.String libraryName)
@Nullable public java.util.Map<java.lang.String,java.lang.Integer> getAttributeValues()
AttrResourceValuegetAttributeValues in interface AttrResourceValue@Nullable
public java.lang.String getValueDescription(@NonNull
java.lang.String valueName)
AttrResourceValuegetValueDescription in interface AttrResourceValue@Nullable public java.lang.String getDescription()
AttrResourceValuegetDescription in interface AttrResourceValue@Nullable public java.lang.String getGroupName()
AttrResourceValue<!-- =========== --> <!-- Text styles --> <!-- =========== --> <eat-comment /> <!-- Default appearance of text: color, typeface, size, and style. --> <attr name="textAppearance" format="reference" />
Attr grouping is available only for the framework resources.
getGroupName in interface AttrResourceValue@NonNull public java.util.Set<AttributeFormat> getFormats()
AttrResourceValuegetFormats in interface AttrResourceValuepublic void addValue(@NonNull
java.lang.String valueName,
@Nullable
java.lang.Integer numericValue,
@Nullable
java.lang.String description)
valueName - the name of the valuenumericValue - the corresponding numeric valuevalueName - the description of the valuepublic void setDescription(@Nullable
java.lang.String description)
description - the description to setpublic void setGroupName(@Nullable
java.lang.String groupName)
groupName - the name of the group to setpublic void setFormats(@NonNull
java.util.Collection<AttributeFormat> formats)
formats - the formats to set