Class RecordRegistry
java.lang.Object
dev.engine.core.layout.RecordRegistry
Registry of record metadata populated at compile time by the
@NativeStruct
annotation processor. Each annotated record gets a generated _NativeStruct
class whose static initializer registers component info here.
This replaces Class.isRecord() and Class.getRecordComponents(),
which are not available on TeaVM. Desktop code can also use this registry,
falling back to native reflection only for unregistered types.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordDescribes one record component: its name, type, and an accessor function that extracts the value from a record instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic RecordRegistry.ComponentInfo[]getComponents(Class<?> clazz) Returns the component metadata for a registered record, or null if not registered.static booleanisRegistered(Class<?> clazz) Returns true if the given class has been registered (i.e., is a@NativeStructrecord).static voidregister(Class<?> recordClass, RecordRegistry.ComponentInfo[] components) Registers record component metadata.
-
Method Details
-
register
Registers record component metadata. Called from generated_NativeStructstatic initializers. -
isRegistered
Returns true if the given class has been registered (i.e., is a@NativeStructrecord). -
getComponents
Returns the component metadata for a registered record, or null if not registered.
-