Class CPGPrinter


  • public class CPGPrinter
    extends Object
    A text renderer for a code property graph, emitting nodes grouped by method or by node type with detail controlled by a GraphPrinterConfig.
    • Constructor Detail

      • CPGPrinter

        public CPGPrinter()
        Creates a printer using the default configuration.
      • CPGPrinter

        public CPGPrinter​(GraphPrinterConfig config)
        Creates a printer with the given configuration.
        Parameters:
        config - grouping, verbosity and truncation settings
    • Method Detail

      • print

        public String print​(CodePropertyGraph cpg)
        Renders the graph to a string.
        Parameters:
        cpg - the graph to print
        Returns:
        the rendered text
      • print

        public void print​(CodePropertyGraph cpg,
                          Writer output)
        Renders the graph to a writer and flushes it.
        Parameters:
        cpg - the graph to print
        output - destination for the rendered text