Package me.ahoo.cosid.accessor.registry
Class DefaultAccessorRegistry
java.lang.Object
me.ahoo.cosid.accessor.registry.DefaultAccessorRegistry
- All Implemented Interfaces:
CosIdAccessorRegistry
Default implementation of
CosIdAccessorRegistry.
Uses a concurrent hash map for thread-safe registration and lazy parsing of accessors.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultAccessorRegistry(CosIdAccessorParser accessorParser) Creates a registry with the specified parser. -
Method Summary
Modifier and TypeMethodDescriptionGets 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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.ahoo.cosid.accessor.registry.CosIdAccessorRegistry
ensureId
-
Constructor Details
-
DefaultAccessorRegistry
Creates a registry with the specified parser.- Parameters:
accessorParser- the parser for creating accessors
-
-
Method Details
-
register
Description copied from interface:CosIdAccessorRegistryRegisters a class, parsing its accessor from annotations.- Specified by:
registerin interfaceCosIdAccessorRegistry- Parameters:
clazz- the class to register
-
register
Description copied from interface:CosIdAccessorRegistryRegisters a class with a specific accessor.- Specified by:
registerin interfaceCosIdAccessorRegistry- Parameters:
clazz- the class to registercosIdAccessor- the accessor to use
-
get
Description copied from interface:CosIdAccessorRegistryGets the accessor for a class.- Specified by:
getin interfaceCosIdAccessorRegistry- Parameters:
clazz- the class- Returns:
- the accessor
-