Class ShadowChainBuilder<S,I>
java.lang.Object
net.sourceforge.pmd.lang.java.symbols.table.coreimpl.ShadowChainBuilder<S,I>
- Type Parameters:
S- Type of symbolsI- Type of scope tags
Build a shadow chain for some type.
Implementing this framework means implementing NameResolvers for
each relevant way that a declaration may be brought in scope, then figuring
out the correct way these resolvers should be linked into a ShadowChain.
Shadow chain builders just give some utility methods to make the linking
process more straightforward.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassHelper to build a new name resolver. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaugment(ShadowChainNode<S, I> parent, boolean shadowBarrier, I scopeTag, NameResolver<? extends S> resolver) augment(ShadowChainNode<S, I> parent, boolean shadowBarrier, I scopeTag, ShadowChainBuilder<S, I>.ResolverBuilder symbols) augmentWithCache(ShadowChainNode<S, I> parent, boolean shadowBarrier, I scopeTag, NameResolver<? extends S> resolver) augmentWithCache(ShadowChainNode<S, I> parent, boolean shadowBarrier, I scopeTag, NameResolver<? extends S> resolver, BinaryOperator<List<S>> merger) copyToMutable(Map<String, V> m) Copy the given map into a new mutable map.abstract StringgetSimpleName(S sym) Returns the name with which the given symbol should be indexed.groupByName(Iterable<? extends N> input, Function<? super N, ? extends @Nullable S> symbolFetcher) groupByName(Iterable<? extends S> tparams) groupByName(S sym) static <S,I> ShadowChainNode<S, I> Returns the singleton for the chain root.shadow(ShadowChainNode<S, I> parent, I scopeTag, NameResolver<S> resolver) shadow(ShadowChainNode<S, I> parent, I scopeTag, ShadowChainBuilder<S, I>.ResolverBuilder resolver) shadowWithCache(ShadowChainNode<S, I> parent, I scopeTag, Map<String, List<S>> cacheMap, NameResolver<S> resolver)
-
Constructor Details
-
ShadowChainBuilder
public ShadowChainBuilder()
-
-
Method Details
-
copyToMutable
Copy the given map into a new mutable map. This is provided as a hook to experiment with alternative map implementations easily, eg tries, or specialized maps. -
getSimpleName
Returns the name with which the given symbol should be indexed. -
rootGroup
Returns the singleton for the chain root. -
augment
public ShadowChainNode<S,I> augment(ShadowChainNode<S, I> parent, boolean shadowBarrier, I scopeTag, ShadowChainBuilder<S, I>.ResolverBuilder symbols) -
augment
public ShadowChainNode<S,I> augment(ShadowChainNode<S, I> parent, boolean shadowBarrier, I scopeTag, NameResolver<? extends S> resolver) -
augment
public ShadowChainNode<S,I> augment(ShadowChainNode<S, I> parent, boolean shadowBarrier, I scopeTag, S symbol) -
augmentWithCache
public ShadowChainNode<S,I> augmentWithCache(ShadowChainNode<S, I> parent, boolean shadowBarrier, I scopeTag, NameResolver<? extends S> resolver) -
augmentWithCache
public ShadowChainNode<S,I> augmentWithCache(ShadowChainNode<S, I> parent, boolean shadowBarrier, I scopeTag, NameResolver<? extends S> resolver, BinaryOperator<List<S>> merger) -
shadowWithCache
public ShadowChainNode<S,I> shadowWithCache(ShadowChainNode<S, I> parent, I scopeTag, Map<String, List<S>> cacheMap, NameResolver<S> resolver) -
shadow
public ShadowChainNode<S,I> shadow(ShadowChainNode<S, I> parent, I scopeTag, ShadowChainBuilder<S, I>.ResolverBuilder resolver) -
shadow
public ShadowChainNode<S,I> shadow(ShadowChainNode<S, I> parent, I scopeTag, NameResolver<S> resolver) -
shadow
-
groupByName
public <N> ShadowChainBuilder<S,I>.ResolverBuilder groupByName(Iterable<? extends N> input, Function<? super N, ? extends @Nullable S> symbolFetcher) -
groupByName
-
groupByName
-