Class 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:

    
          bundle
              .extensions(Ext1.class)
              .modules(new Mod(1), new OtherMod()
              .extensions(Ext2.class)
              .modules(new Mod(2), new Mod(1))
     
    will be reported as
        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
    • 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 interface ReportRenderer<ContextTreeConfig>
        Parameters:
        config - tree rendering config
        Returns:
        rendered tree