package com.volmit; import com.volmit.mantle.MantleCodec; import com.volmit.mantle.MantleKey; import com.volmit.mantle.MantleLifetime; import com.volmit.object.ObjectGeneratorFactory; /** Host implementation collects non-stage registrations before loading pack configuration. * Feature IDs must be unique. JSON fields must be unique per attachment target, including the * settings types stages name in {@code when(...)}. */ public interface FeatureRegistry { /** Registers a layer before pack loading. Null arguments throw NullPointerException; * duplicate IDs and negative codec versions throw IllegalArgumentException. * Only the owner registers a shared layer; consumers refer to its key. The host must * preserve unknown persisted layers or fail explicitly, never silently discard them. * GENERATION layers also require codecs. */ void registerMantle(MantleKey key, MantleLifetime lifetime, MantleCodec codec); void registerObject(Class featureType, ObjectGeneratorFactory factory); }