Class GuiceModelParser

java.lang.Object
ru.vyarus.dropwizard.guice.debug.report.guice.util.GuiceModelParser

public final class GuiceModelParser extends Object
Guice introspection utils. Parse guice SPI model. Supports both elements from modules and injector bindings.
Since:
14.08.2019
  • Method Details

    • parse

      public static List<ModuleDeclaration> parse(com.google.inject.Injector injector, Collection<? extends com.google.inject.spi.Element> elements)
      Parse guice elements into modules tree. Only direct bindings are accepted. Supports both module elements and injector bindings (but result will slightly vary). JIT bindings are also grouped into special module.
      Parameters:
      injector - injector instance
      elements - elements to analyze
      Returns:
      tree of modules.
    • parseElement

      public static BindingDeclaration parseElement(com.google.inject.Injector injector, com.google.inject.spi.Element element)
      Parse single guice element.
      Parameters:
      injector - injector instance
      element - element to analyze
      Returns:
      parsed descriptor or null if element is not supported (or intentionally skipped)