Top Fields Constructors Methods
org.codehaus.groovy.transform.stc

public abstract Class AbstractExtensionMethodCache

extends Object
Class Inheritance
Known Direct Subclasses
org.codehaus.groovy.transform.stc.ExtensionMethodCache
Imports
org.codehaus.groovy.ast.ClassNode, .MethodNode, .Parameter, org.codehaus.groovy.runtime.m12n.ExtensionModule, .ExtensionModuleScanner, .MetaInfExtensionModule, org.codehaus.groovy.runtime.memoize.EvictableCache, .StampedCommonCache, java.util.ArrayList, .Collections, .HashMap, .LinkedHashSet, .LinkedList, .List, .Map, .Set, .WeakHashMap, java.util.function.Function, .Predicate

Since
3.0.0

Field Summary

Modifier and TypeField and Description
pack-priv final EvictableCache<ClassLoader, Map<String, List<MethodNode>>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
accumulate(Map<String, List<MethodNode>> accumulator, boolean isStatic, MethodNode metaMethod, Function<MethodNode, String> mapperFunction)

protected abstract void
addAdditionalClassesToScan(Set<Class<T>> instanceExtClasses, Set<Class<T>> staticExtClasses)

public Map<String, List<MethodNode>>
get(ClassLoader loader)

protected abstract Predicate<MethodNode>
protected abstract Function<MethodNode, String>
private Map<String, List<MethodNode>>
getMethods(List<ExtensionModule>
extension modules
modules
)

Returns a map which contains, as the key, the name of a class.

private Map<String, List<MethodNode>>
private Map<String, List<MethodNode>>
private void
scan(Map<String, List<MethodNode>> accumulator, Iterable<Class<T>> allClasses, boolean isStatic)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheback to summary
pack-priv final EvictableCache<ClassLoader, Map<String, List<MethodNode>>> cache

Constructor Detail

AbstractExtensionMethodCacheback to summary
public AbstractExtensionMethodCache()

Method Detail

accumulateback to summary
private void accumulate(Map<String, List<MethodNode>> accumulator, boolean isStatic, MethodNode metaMethod, Function<MethodNode, String> mapperFunction)
addAdditionalClassesToScanback to summary
protected abstract void addAdditionalClassesToScan(Set<Class<T>> instanceExtClasses, Set<Class<T>> staticExtClasses)
getback to summary
public Map<String, List<MethodNode>> get(ClassLoader loader)
getMethodFilterback to summary
protected abstract Predicate<MethodNode> getMethodFilter()
getMethodMapperback to summary
protected abstract Function<MethodNode, String> getMethodMapper()
getMethodsback to summary
private Map<String, List<MethodNode>> getMethods(List<ExtensionModule> modules)

Returns a map which contains, as the key, the name of a class. The value consists of a list of MethodNode, one for each groovy default method found which is applicable for this class.

Parameters
modules:List<ExtensionModule>

extension modules

getMethodsFromClassLoaderback to summary
private Map<String, List<MethodNode>> getMethodsFromClassLoader(ClassLoader classLoader)
makeMethodsUnmodifiableback to summary
private Map<String, List<MethodNode>> makeMethodsUnmodifiable(Map<String, List<MethodNode>> methods)
scanback to summary
private void scan(Map<String, List<MethodNode>> accumulator, Iterable<Class<T>> allClasses, boolean isStatic)