InspectableProperty
@Target(allowedTargets = [AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER])
@Retention(value = AnnotationRetention.SOURCE)
public annotation InspectableProperty
Denotes that the annotated method is the getter for a resources-backed property that should be shown in Android Studio's inspection tools.
Summary
Nested types |
|---|
@Target(allowedTargets = [AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CLASS])This annotation is deprecated. Replaced by the androidx.resourceinpsection package. |
@Target(allowedTargets = [AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CLASS])This annotation is deprecated. Replaced by the androidx.resourceinpsection package. |
public enum InspectableProperty.ValueType extends EnumThis enum is deprecated. Replaced by the androidx.resourceinpsection package. |
Public constructors |
|---|
This method is deprecated. Replaced by the androidx.resourceinpsection package. |
Public methods |
|
|---|---|
final int |
This method is deprecated. Replaced by the androidx.resourceinpsection package. |
final @NonNull InspectableProperty.EnumEntry[] |
This method is deprecated. Replaced by the androidx.resourceinpsection package. |
final @NonNull InspectableProperty.FlagEntry[] |
This method is deprecated. Replaced by the androidx.resourceinpsection package. |
final boolean |
This method is deprecated. Replaced by the androidx.resourceinpsection package. |
final @NonNull String |
This method is deprecated. Replaced by the androidx.resourceinpsection package. |
final @NonNull InspectableProperty.ValueType |
This method is deprecated. Replaced by the androidx.resourceinpsection package. |
Public constructors
InspectableProperty
publicInspectableProperty(
@NonNull String name,
int attributeId,
boolean hasAttributeId,
@NonNull InspectableProperty.ValueType valueType,
@NonNull InspectableProperty.EnumEntry[] enumMapping,
@NonNull InspectableProperty.FlagEntry[] flagMapping
)
Public methods
getAttributeId
public final int getAttributeId()If the property is inflated from XML, the resource ID of its XML attribute.
If left as the default, and hasAttributeId is true, the attribute ID will be inferred from name.
| Returns | |
|---|---|
int |
The attribute ID of the property or the default null resource ID |
getEnumMapping
public final @NonNull InspectableProperty.EnumEntry[]getEnumMapping()
For enumerations packed into primitive {int} properties, map the values to string names.
Note that #enumMapping() cannot be used simultaneously with flagMapping.
getFlagMapping
public final @NonNull InspectableProperty.FlagEntry[]getFlagMapping()
For flags packed into primitive {int} properties, model the string names of the flags.
Note that #flagMapping() cannot be used simultaneously with enumMapping.
getHasAttributeId
public final boolean getHasAttributeId()If this property has an attribute ID.
Set to false if the annotated property does not have an attribute ID, that is, it is not inflated from an XML attribute. This will prevent the automatic inference of the attribute.
| Returns | |
|---|---|
boolean |
Whether to infer an attribute ID if not supplied |
getName
public final @NonNull StringgetName()
The name of the property.
If left empty (the default), the property name will be inferred from the name of the getter method.
getValueType
public final @NonNull InspectableProperty.ValueTypegetValueType()
Specify how to interpret a value type packed into a primitive integer.
| Returns | |
|---|---|
@NonNull InspectableProperty.ValueType |