methodBlacklistRegexp

Description

With the help of this configuration parameter it is possible to ignore/remove specific method calls and their subsequent calls from the sequence flow.

Default value

The default value of this configuration parameter is null (nothing ignored/removed).

Example

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

// ARRANGE
PlantUMLSequenceDiagramConfigBuilder builder = new PlantUMLSequenceDiagramConfigBuilder(User.class.getName(),
		"interaction").withMethodBlacklistRegexp("getData"); (1)
PlantUMLSequenceDiagramGenerator generator = new PlantUMLSequenceDiagramGenerator(builder.build());
String expectedDiagramText = IOUtils.toString(
		Objects.requireNonNull(classLoader.getResource("sequence/0004_sequence_diagram_with_blacklisted_method.txt")),
		StandardCharsets.UTF_8);

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

// ASSERT
assertAll(() -> assertNotNull(generatedDiagram), () -> assertEquals(expectedDiagramText.replaceAll("\\s+", ""),
		generatedDiagram.replaceAll("\\s+", "")));
1 ignore/remove method calls to "getData"

which is rendered this way:

0004_sequence_diagram_with_blacklisted_method_diagram

and produces this PlantUML diagram text:

@startuml

participant User
participant View
participant Controller
participant Model

activate User
	User -> View : interact
	activate View
		View -> Controller : handleEvent
		activate Controller
			Controller -> Model : manipulate
			activate Model
				Model -> View : notifyView
				activate View
					View --> Model
				deactivate View
				Model --> Controller
			deactivate Model
			Controller --> View
		deactivate Controller
		View --> User
	deactivate View
deactivate User

@enduml

Without the parameter the diagram would look like this:

0004_sequence_diagram_with_custom_classloader_diagram