Interface NameResolver<S>
- Type Parameters:
S- Type of symbols
- All Known Subinterfaces:
NameResolver.SingleNameResolver<S>
public interface NameResolver<S>
Name resolvers are strategies backing
ShadowChains. They have
no information about outer context, instead the structure of the shadow
group chain handles that.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA base class for resolvers that know at most one symbol for any given name. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> NameResolver<T>composite(List<? extends NameResolver<? extends T>> resolvers) Returns a resolver that concatenates the results of every resolver in the given list.default booleanReturns true if this resolver knows it cannot resolve anything.default @NonNull OptionalBoolReturns whether this resolver knows if it has a declaration for the given name.default @Nullable SresolveFirst(String simpleName) Resolves the first symbol that would be part of the list yielded byresolveHere(String)for the given name.resolveHere(String simpleName) Returns all symbols known by this resolver that have the given simple name.toString()Please implement toString to ease debugging.
-
Method Details
-
resolveHere
Returns all symbols known by this resolver that have the given simple name. Depending on language semantics, finding several symbols may mean there is ambiguity. If no such symbol is known, returns an empty list.- Parameters:
simpleName- Simple name
-
resolveFirst
Resolves the first symbol that would be part of the list yielded byresolveHere(String)for the given name. If the list would be empty (no such symbol is known), returns null. -
knows
Returns whether this resolver knows if it has a declaration for the given name. If the result is NO, then resolveFirst MUST be null, if the result is YES, then resolveFirst MUST be non-null. Otherwise we don't know. -
isDefinitelyEmpty
default boolean isDefinitelyEmpty()Returns true if this resolver knows it cannot resolve anything. -
toString
String toString()Please implement toString to ease debugging. -
composite
Returns a resolver that concatenates the results of every resolver in the given list.- Type Parameters:
T- Type of symbol- Parameters:
resolvers- Resolvers
-