Class RecordRegistry

java.lang.Object
dev.engine.core.layout.RecordRegistry

public final class RecordRegistry extends Object
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.

  • Method Details

    • register

      public static void register(Class<?> recordClass, RecordRegistry.ComponentInfo[] components)
      Registers record component metadata. Called from generated _NativeStruct static initializers.
    • isRegistered

      public static boolean isRegistered(Class<?> clazz)
      Returns true if the given class has been registered (i.e., is a @NativeStruct record).
    • getComponents

      public static RecordRegistry.ComponentInfo[] getComponents(Class<?> clazz)
      Returns the component metadata for a registered record, or null if not registered.