org.springframework.core.type.classreading

Class CachingMetadataReaderFactory

    • Field Detail

      • DEFAULT_CACHE_LIMIT

        public static final int DEFAULT_CACHE_LIMIT
        Default maximum number of entries for the MetadataReader cache: 256
        See Also:
        Constant Field Values
    • Constructor Detail

      • CachingMetadataReaderFactory

        public CachingMetadataReaderFactory()
        Create a new CachingMetadataReaderFactory for the default class loader.
      • CachingMetadataReaderFactory

        public CachingMetadataReaderFactory(ResourceLoader resourceLoader)
        Create a new CachingMetadataReaderFactory for the given resource loader.
        Parameters:
        resourceLoader - the Spring ResourceLoader to use (also determines the ClassLoader to use)
      • CachingMetadataReaderFactory

        public CachingMetadataReaderFactory(ClassLoader classLoader)
        Create a new CachingMetadataReaderFactory for the given class loader.
        Parameters:
        classLoader - the ClassLoader to use
    • Method Detail

      • setCacheLimit

        public void setCacheLimit(int cacheLimit)
        Specify the maximum number of entries for the MetadataReader cache. Default is 256.
      • getCacheLimit

        public int getCacheLimit()
        Return the maximum number of entries for the MetadataReader cache.
      • clearCache

        public void clearCache()
        Clear the entire MetadataReader cache, removing all cached class metadata.