{% setvar book_path %}/reference/dokkatest/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
annotation InspectableProperty
Marks a getter of a property on an inspectable node. This annotation is inherited by default. If a child class doesn't add it to a getter, but a parent class does, the property will be inspected, even if the child overrides the definition of the getter. If a child class defines a property of the same name of a property on the parent but on a different getter, the inspector will use the child's getter when inspecting instances of the child, and the parent's otherwise.
See also | |
---|---|
InspectionCompanion |
InspectionCompanion#mapProperties(PropertyMapper) |
InspectionCompanion |
InspectionCompanion#readProperties(Object, PropertyReader) |
Nested types |
|
---|---|
InspectableProperty.EnumEntry |
One entry in an enumeration packed into a primitive {int}. |
InspectableProperty.FlagEntry |
One flag value of many that may be packed into a primitive {int}. |
InspectableProperty.ValueType |
The type of value packed into a primitive {int}. |
Public methods |
|
---|---|
abstract @NonNull int |
If the property is inflated from XML, the resource ID of its XML attribute.If left as {ID_NULL}, and |
abstract @NonNull Array<@NonNull InspectableProperty.EnumEntry> |
For enumerations packed into primitive {int} properties, map the values to string names.Note that |
abstract @NonNull Array<@NonNull InspectableProperty.FlagEntry> |
For flags packed into primitive {int} properties, model the string names of the flags.Note that |
abstract @NonNull boolean |
If this property has an attribute ID.Set to false if the annotated property does not have an attribute ID, that is, it is notinflated from an XML attribute. |
abstract @NonNull String |
name() The name of the property.If left empty (the default), the property name will be inferred from the name of the gettermethod. |
abstract @NonNull InspectableProperty.ValueType |
Specify how to interpret a value type packed into a primitive integer. |
@NonNull
public abstract int attributeId()
If the property is inflated from XML, the resource ID of its XML attribute.If left as {ID_NULL}, and hasAttributeId
is true, the attribute ID will beinferred from name
.
Returns | |
---|---|
int |
The attribute ID of the property or ID_NULL |
@NonNull
public abstract Array<@NonNull InspectableProperty.EnumEntry> enumMapping()
For enumerations packed into primitive {int} properties, map the values to string names.Note that enumMapping
cannot be used simultaneously with flagMapping
.
Returns | |
---|---|
Array<@NonNull InspectableProperty.EnumEntry> |
An array of |
See also | |
---|---|
IntDef |
@NonNull
public abstract Array<@NonNull InspectableProperty.FlagEntry> flagMapping()
For flags packed into primitive {int} properties, model the string names of the flags.Note that flagMapping
cannot be used simultaneously with enumMapping
.
Returns | |
---|---|
Array<@NonNull InspectableProperty.FlagEntry> |
An array of |
See also | |
---|---|
IntDef |
|
IntFlagMapping |
@NonNull
public abstract boolean hasAttributeId()
If this property has an attribute ID.Set to false if the annotated property does not have an attribute ID, that is, it is notinflated from an XML attribute. This will prevent the automatic inference of the attributeID if attributeId
is set to ID_NULL.
Returns | |
---|---|
boolean |
Whether to infer an attribute ID if not supplied |
@NonNull
public abstract String name()
The name of the property.If left empty (the default), the property name will be inferred from the name of the gettermethod.
Returns | |
---|---|
String |
The name of the property. |
@NonNull
public abstract InspectableProperty.ValueType valueType()
Specify how to interpret a value type packed into a primitive integer.
Returns | |
---|---|
InspectableProperty.ValueType |