Interface SymbolResolver

  • All Known Implementing Classes:
    AsmSymbolResolver

    public interface SymbolResolver
    Resolves symbols from their global name. This abstracts over whether we're looking on a classpath, in a file tree, in a serialized index, etc.
    • Method Detail

      • resolveClassFromBinaryName

        @Nullable JClassSymbol resolveClassFromBinaryName​(@NonNull String binaryName)
        Resolves a class symbol from its canonical name. Periods ('.') will not be interpreted as nested-class separators, so this performs at most one classloader lookup. Note that external symbol resolvers do not need to implement lookup for primitive types, for local and anonymous classes, or for array classes. This is handled by the AST implementation or by the type system. Looking up such symbols is undefined behaviour.
      • resolveClassFromCanonicalName

        default @Nullable JClassSymbol resolveClassFromCanonicalName​(@NonNull String canonicalName)
        Resolves a class symbol from its canonical name. Periods ('.') may be interpreted as nested-class separators, so for n segments, this performs at most n classloader lookups.
      • layer

        static SymbolResolver layer​(SymbolResolver first,
                                    SymbolResolver... others)
        Produce a symbol resolver that asks the given resolvers in order.
        Parameters:
        first - First resolver
        others - Rest of the resolvers