fieldBlacklistRegexp

Description

With this configuration option you can add a regular expression to the configuration to filter out specific fields from the diagram.

Default value

The default value of this configuration is null.

Example

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

String filename = "class/0018_blacklist_fields.txt";
classLoader.loadClass("de.elnarion.test.domain.t0018.Testclass1");
List<String> scanPackages = new ArrayList<>();
scanPackages.add("de.elnarion.test.domain.t0018");
PlantUMLClassDiagramConfig config = new PlantUMLClassDiagramConfigBuilder(scanPackages)
        .withFieldBlacklistRegexp("test1").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 blacklist regular expression to the configuration

which is rendered this way:

0018_blacklist_fields_diagram

and produces this PlantUML diagram text:

@startuml

class de.elnarion.test.domain.t0018.Testclass1 {
	{field} +testfield : long
	{method} +doSomething () : void
}

class de.elnarion.test.domain.t0018.Testclass2 {
	{method} #doSomething () : void
}

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

@enduml