hideSuperClass
Description
With the help of this configuration parameter it is possible to show the method call as part of the child class instead of the super class if the call starts from the child class.
Example
Here is an example from the JUnit tests using this configuration parameter:
// ARRANGE
PlantUMLSequenceDiagramConfigBuilder builder = new PlantUMLSequenceDiagramConfigBuilder(
CallerClassA.class.getName(), "testSomething").withHideSuperClass(true); (1)
PlantUMLSequenceDiagramGenerator generator = new PlantUMLSequenceDiagramGenerator(builder.build());
String expectedDiagramText = IOUtils.toString(
Objects.requireNonNull(classLoader.getResource("sequence/0002_basic_super_class_sequence_diagram_with_hide_super_class.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:
and produces this PlantUML diagram text:
@startuml
participant CallerClassA
participant SuperClassB
activate CallerClassA
CallerClassA -> CallerClassA : testSuperClassSomething
activate CallerClassA
CallerClassA -> SuperClassB : testSuperClassBSomething
activate SuperClassB
SuperClassB -> SuperClassB : testProtectedSomething
activate SuperClassB
SuperClassB --> SuperClassB
deactivate SuperClassB
SuperClassB --> CallerClassA
deactivate SuperClassB
CallerClassA --> CallerClassA
deactivate CallerClassA
deactivate CallerClassA
@enduml
Without the parameter the diagram would look like this: