API reference

SpatialIdRegistry Object

Global lookup of stable component and attribute IDs assigned at APK build time.
Aether components and their attributes are identified at runtime by Int IDs. Historically these came from Android resource IDs (R.id.*) populated by AAPT2 at the consuming APK's link time — which made the integers unstable across builds and consumers, breaking compiled-AAR distribution.
The new pipeline assigns deterministic IDs from 1 by post-processing the APK's component XMLs (extracted from each AAR's components directory). The result is packaged into the APK as a name → ID map asset; at process startup the bootstrap reads that asset and calls SpatialIdRegistry.install. Generated component companions then read their IDs eagerly at companion class init via SpatialIdRegistry.component and SpatialIdRegistry.attribute.
After class init the IDs are plain Int fields on the companion — accesses are single field reads, with no per-access lazy delegate, no synchronization, and no allocation.
Bootstrap order requirement: SpatialIdRegistry.install must be called before any component companion is referenced (registration, queries, attribute access). Misordered access throws — the failure is intentionally loud because silent ID corruption is far worse than a clear startup crash.

Signature

object SpatialIdRegistry

Methods

attribute ( className , propName )
Looks up the ID for an attribute. Called from generated companion <clinit>.
Signature
fun attribute(className: String, propName: String): Int
Parameters
className: String  the owning component's simple class name
propName: String  the attribute's name as declared in its XML schema
Returns
Int
Throws
IllegalStateException  if SpatialIdRegistry.install has not yet run, or if no ID was assigned for the given pair.
component ( name )
Looks up the ID for a component class. Called from generated companion <clinit>.
Signature
fun component(name: String): Int
Parameters
name: String  the component's simple class name as declared in its XML schema
Returns
Int
Throws
IllegalStateException  if SpatialIdRegistry.install has not yet run, or if no ID was assigned for SpatialIdRegistry.component.
install ( componentMap , attributeMap )
Installs the build-time name → ID maps. Called once during process bootstrap before any component companion is touched. Re-installation replaces the previous maps; this supports tests that need to swap fixtures between cases.
Signature
fun install(componentMap: Map<String, Int>, attributeMap: Map<String, Int>)
Parameters
componentMap: Map  simple component name (e.g. "Named") → assigned ID.
attributeMap: Map "ComponentName.attributeName" → assigned ID.
reset ()
Test-only: clears the installed maps so a subsequent SpatialIdRegistry.install starts from a clean slate.
Signature
fun reset()