classBlacklistRegexp

Description

With the help of this configuration parameter it is possible to remove classes from the call sequence flow. If they are removed, no subsequent calls are part of the diagram anymore.

Default value

The default value of this configuration parameter is null (nothing is blacklisted).

Example

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

// ARRANGE
PlantUMLSequenceDiagramConfigBuilder builder = new PlantUMLSequenceDiagramConfigBuilder(User.class.getName(),
		"interaction").withClassBlacklistRegexp(".*(Controller|Model)"); (1)
PlantUMLSequenceDiagramGenerator generator = new PlantUMLSequenceDiagramGenerator(builder.build());
String expectedDiagramText = IOUtils.toString(
		Objects.requireNonNull(classLoader.getResource("sequence/0004_sequence_diagram_with_blacklisted_classes.txt")),
		StandardCharsets.UTF_8);

// ACT
String generatedDiagram = generator.generateDiagramText();

// ASSERT
assertAll(() -> assertNotNull(generatedDiagram), () -> assertEquals(expectedDiagramText.replaceAll("\\s+", ""),
		generatedDiagram.replaceAll("\\s+", "")));
1 add regular expression to remove all classes ending with Controller or Model

which is rendered this way:

0004_sequence_diagram_with_blacklisted_classes_diagram

and produces this PlantUML diagram text:

@startuml

participant User
participant View

activate User
	User -> View : interact
	activate View
		View --> User
	deactivate View
deactivate User

@enduml

Without the blacklist the diagram would look like this:

0004_sequence_diagram_with_custom_classloader_diagram