Class ContextTreeRenderer
- java.lang.Object
-
- ru.vyarus.dropwizard.guice.debug.report.tree.ContextTreeRenderer
-
- All Implemented Interfaces:
ReportRenderer<ContextTreeConfig>
public class ContextTreeRenderer extends java.lang.Object implements ReportRenderer<ContextTreeConfig>
Renders complete configuration tree.Different instance items of the same type are marker by "#N" numbers. The only exception is duplicates - original registered item name used (which this ignored instance is equal to) to indicate duplicate.
Report tries to preserve registration order but only within extension types. The only exception is ignored instances, which are printed directly after original item appearance, even if they were registered further in this scope. For example, for registration like this:
will be reported asbundle .extensions(Ext1.class) .modules(new Mod(1), new OtherMod() .extensions(Ext2.class) .modules(new Mod(2), new Mod(1))
extension Ext1 extension Ext2 module Mod module -Mod *DUPLICATE module OtherMod module Mod#2
Which should be enough to associate with real configuration.Used markers:
- DW - marks dropwizard bundles
- OPTIONAL - marks optional extensions
- DISABLED - item disabled (by user)
- DUPLICATE - item considered as duplicate by deduplication mechanism and ignored. If contains number ("DUPLICATE(3)") then multiple instances were considered duplicate in this scope and ignored.
Recognized guice bindings are shown as separate subtree "GUICE BINDINGS" and not under modules in configuration tree because it is impossible to associate binding with exact module instance (and multiple instances of the same module could be registered). So bindings report is a "projection on class level".
- Since:
- 17.07.2016
-
-
Constructor Summary
Constructors Constructor Description ContextTreeRenderer(GuiceyConfigurationInfo service)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
renderReport(ContextTreeConfig config)
Renders configuration tree report according to provided config.
-
-
-
Constructor Detail
-
ContextTreeRenderer
public ContextTreeRenderer(GuiceyConfigurationInfo service)
-
-
Method Detail
-
renderReport
public java.lang.String renderReport(ContextTreeConfig config)
Renders configuration tree report according to provided config. By default report padded left with one tab. Subtrees are always padded with empty lines for better visibility.- Specified by:
renderReport
in interfaceReportRenderer<ContextTreeConfig>
- Parameters:
config
- tree rendering config- Returns:
- rendered tree
-
-