Class AbstractExtensionMethodCache
java.lang.Object
org.codehaus.groovy.transform.stc.AbstractExtensionMethodCache
- Direct Known Subclasses:
ExtensionMethodCache
Per-
ClassLoader cache of extension methods (DGM and friends, or
another mapper such as macro methods). Values are immutable lists that
also carry a name index, so a named lookup does not scan every method
stored under a receiver (there are hundreds on Object).- Since:
- 3.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaddAdditionalClassesToScan(Set<Class> instanceExtClasses, Set<Class> staticExtClasses) Adds implementation-specific extension classes to the scan sets.final Map<String,List<MethodNode>> get(ClassLoader loader) Returns the cached extension methods for the supplied class loader.protected abstract StringReturns the system property used to disable selected extension methods.protected abstract Predicate<MethodNode>Returns a predicate that excludes methods from the cache.protected abstract Function<MethodNode,String> Maps an extension method to the cache key used during lookup.
-
Constructor Details
-
AbstractExtensionMethodCache
public AbstractExtensionMethodCache()
-
-
Method Details
-
get
Returns the cached extension methods for the supplied class loader. Each list is immutable and indexed by method name. -
addAdditionalClassesToScan
protected abstract void addAdditionalClassesToScan(Set<Class> instanceExtClasses, Set<Class> staticExtClasses) Adds implementation-specific extension classes to the scan sets. -
getDisablePropertyName
Returns the system property used to disable selected extension methods. -
getMethodFilter
Returns a predicate that excludes methods from the cache. -
getMethodMapper
Maps an extension method to the cache key used during lookup.
-