Package me.ahoo.cosid.accessor.registry
Interface CosIdAccessorRegistry
- All Known Implementing Classes:
DefaultAccessorRegistry
@ThreadSafe
public interface CosIdAccessorRegistry
Registry for managing
CosIdAccessor instances.
Provides registration and lookup of ID accessors for classes, enabling automatic ID injection for entities.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanEnsures the target object has an ID, registering if needed.Gets the accessor for a class.voidRegisters a class, parsing its accessor from annotations.voidregister(Class<?> clazz, CosIdAccessor cosIdAccessor) Registers a class with a specific accessor.
-
Method Details
-
register
Registers a class, parsing its accessor from annotations.- Parameters:
clazz- the class to register
-
register
Registers a class with a specific accessor.- Parameters:
clazz- the class to registercosIdAccessor- the accessor to use
-
get
Gets the accessor for a class.- Parameters:
clazz- the class- Returns:
- the accessor
-
ensureId
Ensures the target object has an ID, registering if needed.- Parameters:
target- the target object- Returns:
- true if ID was ensured
-