removeMethods

Description

With this configuration toggle you can remove all methods from the generated diagram text.

If you want to remove specific methods from the diagram, you have to use the methods blacklist regular expression configuration option.

If you want to hide all methods on the rendered diagram but do not want to remove them from the diagram text, you have to use the hide methods configuration option.

Default value

The default value of this configuration option is false (nothing is removed).

Example

Here is an example from the JUnit tests using this configuration parameter:

String filename = "class/0015_remove_methods.txt";
classLoader.loadClass("de.elnarion.test.domain.t0015.Testclass1");
classLoader.loadClass("de.elnarion.test.domain.t0015.Testclass2");
List<String> scanPackages = new ArrayList<>();
scanPackages.add("de.elnarion.test.domain.t0015");
PlantUMLClassDiagramConfig config = new PlantUMLClassDiagramConfigBuilder(scanPackages).withRemoveMethods(true)
        .build(); (1)
PlantUMLClassDiagramGenerator generator = new PlantUMLClassDiagramGenerator(config);
String result = generator.generateDiagramText();
String expectedDiagramText = IOUtils.toString(Objects.requireNonNull(classLoader.getResource(filename)), StandardCharsets.UTF_8);
assertNotNull(result);
assertNotNull(expectedDiagramText);
assertEquals(expectedDiagramText.replaceAll("\\s+", ""), result.replaceAll("\\s+", ""));
1 toggle "remove methods" configuration

which is rendered this way:

0015_remove_methods_diagram

and produces this PlantUML diagram text:

@startuml

class de.elnarion.test.domain.t0015.Testclass1 {
	{field} +testfield : long
}

class de.elnarion.test.domain.t0015.Testclass2 {
}

de.elnarion.test.domain.t0015.Testclass1 -->  de.elnarion.test.domain.t0015.Testclass2 : testfield2

@enduml