Class PlantUMLClassDiagramGenerator

java.lang.Object
de.elnarion.util.plantuml.generator.classdiagram.PlantUMLClassDiagramGenerator

public class PlantUMLClassDiagramGenerator extends Object
This class provides the ability to generate a PlantUML class diagram out of a list of package names. Therefore, this class scans directories and jars for all classes contained directly in these packages and generates a class diagram out of them via reflection

To be able to get the right classes you have to provide the necessary ClassLoader, which is able to load these classes.

Currently, this generator supports the following class types:

  • class
  • abstract class
  • annotation
  • enum
  • interface
with some restrictions:

The type annotation does not contain any further information than its name and no Annotation relationships are included in the diagram.

The type enum contains only the constants.

All other types contain field and method information.

Relationships are included for

  • inheritance
  • realization
  • aggregation (only for List and Set types)
  • usage (only direct usage via field)
You can hide all fields via hideFields parameter, or you can hide all methods via hideMethods parameter.

If you want to hide a list of classes you have to provide a String List with full qualified class names.

  • Constructor Details

    • PlantUMLClassDiagramGenerator

      public PlantUMLClassDiagramGenerator(PlantUMLClassDiagramConfig paramPlantUMLConfig)
      Instantiates a new plant UML class diagram generator.
      Parameters:
      paramPlantUMLConfig - the param plant UML config
  • Method Details

    • generateDiagramText

      public String generateDiagramText()
      Generate the class diagram string for all classes in the configured packages.
      Returns:
      String - the text containing all Plant UML class diagram definitions