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.
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+", "")));
which is rendered this way:
![0004_sequence_diagram_with_blacklisted_classes_diagram](../../_images/0004_sequence_diagram_with_blacklisted_classes_diagram-c0144fc101a3f524c7d49e0badb125744f9fff10.png)
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](../../_images/0004_sequence_diagram_with_custom_classloader_diagram-4c3a03a1eb6fa119fc685763c851119f917d924a.png)