CacheableMetadataParser

Abstract base class for metadata parsers that provides caching functionality to improve performance by avoiding repeated parsing of the same class metadata. This class implements a thread-safe caching mechanism using ConcurrentHashMap to store parsed metadata.

Subclasses must implement the parseToMetadata method to provide the actual parsing logic.

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun <TYPE : Any, M : Metadata> parse(type: Class<TYPE>): M

Parses metadata for the given class type, utilizing caching to avoid redundant parsing operations. If metadata for the class has already been parsed and cached, returns the cached instance. Otherwise, parses the metadata using parseToMetadata and stores it in the cache.

Link copied to clipboard
abstract fun <TYPE : Any, M : Metadata> parseToMetadata(type: Class<TYPE>): M

Abstract method that must be implemented by subclasses to provide the actual metadata parsing logic. This method is called only when metadata for a class is not already cached.