{% setvar book_path %}/reference/kotlin/dokkatest/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

InspectableProperty

{% setvar page_path %}dokkatest/platform/InspectableProperty.html{% endsetvar %} {% setvar can_switch %}1{% endsetvar %} {% include "reference/_kotlin_switcher2.md" %}

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)

Summary

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 functions

abstract Int

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.

abstract Array<InspectableProperty.EnumEntry>

For enumerations packed into primitive {int} properties, map the values to string names.Note that enumMapping cannot be used simultaneously with flagMapping.

abstract Array<InspectableProperty.FlagEntry>

For flags packed into primitive {int} properties, model the string names of the flags.Note that flagMapping cannot be used simultaneously with enumMapping.

abstract 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 String

The name of the property.If left empty (the default), the property name will be inferred from the name of the gettermethod.

abstract InspectableProperty.ValueType

Specify how to interpret a value type packed into a primitive integer.

Public functions

attributeId

abstract fun attributeId(): Int

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

enumMapping

abstract fun enumMapping(): Array<InspectableProperty.EnumEntry>

For enumerations packed into primitive {int} properties, map the values to string names.Note that enumMapping cannot be used simultaneously with flagMapping.

Returns
Array<InspectableProperty.EnumEntry>

An array of EnumEntry, empty if not applicable

See also
IntDef

flagMapping

abstract fun flagMapping(): Array<InspectableProperty.FlagEntry>

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<InspectableProperty.FlagEntry>

An array of FlagEntry, empty if not applicable

See also
IntDef
IntFlagMapping

hasAttributeId

abstract fun hasAttributeId(): 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. 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

name

abstract fun name(): String

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.

valueType

abstract fun valueType(): InspectableProperty.ValueType

Specify how to interpret a value type packed into a primitive integer.

Returns
InspectableProperty.ValueType

A ValueType