fieldClassifierToIgnore

Description

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

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

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

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

  • ABSTRACT_STATIC - all static abstract fields are filtered out

  • NONE - all fields 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/0019_ignore_classifier_fields.txt";
List<String> scanPackages = new ArrayList<>();
scanPackages.add("de.elnarion.test.domain.t0019");
PlantUMLClassDiagramConfig config = new PlantUMLClassDiagramConfigBuilder(scanPackages)
        .addFieldClassifierToIgnore(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 field classifier to ignore to the configuration

which is rendered this way:

0019_ignore_classifier_fields_diagram

and produces this PlantUML diagram text:

@startuml

abstract class de.elnarion.test.domain.t0019.Testclass {
	{field} +test10 : String
	{field} -test2 : String
	{field} -test3 : String
	{field} #test4 : String
	{field} #test6 : String
	{field} #test7 : String
	{field} +test9 : String
}

@enduml