Class BasicResolver

java.lang.Object
software.coley.sourcesolver.resolve.BasicResolver
All Implemented Interfaces:
Resolver

public class BasicResolver extends Object implements Resolver
Base resolver implementation.
Author:
Matt Coley
  • Constructor Details

    • BasicResolver

      public BasicResolver(@Nonnull CompilationUnitModel unit, @Nonnull EntryPool pool)
      Parameters:
      unit - Root element model to resolve contents of.
      pool - Pool to access class metadata.
  • Method Details

    • getUnit

      @Nonnull protected CompilationUnitModel getUnit()
      Returns:
      Backing compilation unit to resolve contents of.
    • populateImports

      @Nonnull protected Map<String,ClassEntry> populateImports()
      Returns:
      Map of internal names to class entries for all imported (implicit and explicit) classes in the compilation unit.
    • resolveAt

      @Nonnull public Resolution resolveAt(int position, @Nullable Model target)
      Specified by:
      resolveAt in interface Resolver
      Parameters:
      position - Absolute position in the source code of the item we want to resolve.
      target - The target model to resolve. Can be null to auto-pick a model at the given position.
      Returns:
      Resolution of what the given target model represents.
    • resolve

      @Nonnull protected Resolution resolve(@Nonnull Model target)