methodClassifierToIgnore

Description

With this configuration list option you can filter out methods by their classifier from the diagram.

You can add any of the following values to the configuration list:

  • ABSTRACT - all abstract non-static methods are filtered out

  • STATIC - all static non-abstract methods are filtered out

  • ABSTRACT_STATIC - all static abstract methods are filtered out

  • NONE - all methods without abstract or static classifier are filtered out

Default value

The default value of this configuration option is an empty list (no filtering via classifier).

Example

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

String filename = "class/0020_ignore_classifier_methods.txt";
classLoader.loadClass("de.elnarion.test.domain.t0020.Testclass");
List<String> scanPackages = new ArrayList<>();
scanPackages.add("de.elnarion.test.domain.t0020");
PlantUMLClassDiagramConfig config = new PlantUMLClassDiagramConfigBuilder(scanPackages)
        .addMethodClassifierToIgnore(ClassifierType.STATIC).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 add method classifier to ignore to the configuration

which is rendered this way:

0020_ignore_classifier_methods_diagram

and produces this PlantUML diagram text:

@startuml

abstract class de.elnarion.test.domain.t0020.Testclass {
	{method}  {abstract} +doSomething () : void
}

interface de.elnarion.test.domain.t0020.Testinterface {
	{method}  {abstract} +doSomething () : void
	{method}  {abstract} +doSomething2 () : void
	{method} +doSomething3 () : void
}

@enduml