Class MarkdownMIBTreeFormatter

java.lang.Object
org.snmp4j.agent.util.MarkdownMIBTreeFormatter
All Implemented Interfaces:
MIBTreeFormatter

public class MarkdownMIBTreeFormatter extends Object implements MIBTreeFormatter
Renders a MIBTree as a compact GitHub-flavored Markdown document that gives a human readable overview of a MIB configuration.

The OID hierarchy is rendered as a nested bullet list in which chains of intermediate nodes with a single child are collapsed, so each bullet is the full OID of a branching point or a configured managed object. Scalar objects show their SMI syntax and value inline; conceptual tables are rendered as Markdown tables (one row per configured row, one column per configured column). Values that reference a runtime instance which could not be resolved statically are shown as their configured reference token.

Since:
3.9.2
Version:
3.9.2
Author:
SNMP4J.org
  • Constructor Details

    • MarkdownMIBTreeFormatter

      public MarkdownMIBTreeFormatter()
  • Method Details

    • format

      public String format(MIBTree tree)
      Description copied from interface: MIBTreeFormatter
      Formats the given MIB tree and returns the result as a string.
      Specified by:
      format in interface MIBTreeFormatter
      Parameters:
      tree - the MIB tree to format.
      Returns:
      the formatted representation.
    • format

      public void format(MIBTree tree, Appendable out) throws IOException
      Description copied from interface: MIBTreeFormatter
      Formats the given MIB tree and appends the result to the supplied Appendable.
      Specified by:
      format in interface MIBTreeFormatter
      Parameters:
      tree - the MIB tree to format.
      out - the target to append the formatted representation to.
      Throws:
      IOException - if appending to out fails.