Class ConfigValueResolver

java.lang.Object
tech.guilhermekaua.spigotboot.config.injector.ConfigValueResolver

public class ConfigValueResolver extends Object
Resolves the value for a @ConfigValue-annotated injection point.

Holds all resolution logic so ConfigValueInjector stays a thin adapter. Detects the addressing mode, builds the lookup path, reads the value (or the default) through DefaultConfigManager, and fails fast with a ConfigException naming the injection site on any misconfiguration.

  • Constructor Details

    • ConfigValueResolver

      public ConfigValueResolver(@NotNull @NotNull DefaultConfigManager configManager)
      Creates a resolver.
      Parameters:
      configManager - the config manager, not null
  • Method Details

    • resolve

      @Nullable public @Nullable Object resolve(@NotNull @NotNull InjectionPoint injectionPoint)
      Resolves the value to inject for the given @ConfigValue injection point.
      Parameters:
      injectionPoint - the injection point, not null
      Returns:
      the resolved value (may be null only if a registered serializer yields null)
      Throws:
      ConfigException - on any misconfiguration or missing required value