hideClasses

Description

With this configuration toggle you can hide a class in the rendered diagram but it is still part of the generated diagram.

If you want to remove the class completely, you have to use a blacklist regular expression

Default value

The default value of this configuration option is an empty list (no class is hidden).

Example

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

List<String> scanPackages = new ArrayList<>();
scanPackages.add("de.elnarion.test.domain.t0001");
List<String> hideClasses = new ArrayList<>(); (1)
hideClasses.add("de.elnarion.test.domain.ChildB");
PlantUMLClassDiagramConfigBuilder configBuilder = new PlantUMLClassDiagramConfigBuilder(scanPackages) (2)
        .withHideClasses(hideClasses); (3)
PlantUMLClassDiagramGenerator generator = new PlantUMLClassDiagramGenerator(configBuilder.build()); (4)
String result = generator.generateDiagramText(); (5)
String expectedDiagramText = IOUtils.toString(Objects.requireNonNull(classLoader.getResource("class/0001_general_diagram.txt")),
        StandardCharsets.UTF_8);
assertNotNull(result);
assertNotNull(expectedDiagramText);
assertEquals(expectedDiagramText.replaceAll("\\s+", ""), result.replaceAll("\\s+", ""));
1 list of strings (class names) is declared for parameter hideclasses
2 packages with all classes to show in the diagramm are added as string list
3 parameters hideclasses and classloader are added to configuration builder
4 generator is initialized with configuration of builder
5 diagram is generated

which is rendered in PlantUML this way:

0001_general_diagram

and produces this PlantUML diagram text:

@startuml

class de.elnarion.test.domain.t0001.BaseAbstractClass {
	{method} +doSomething () : void
	{method} +doSomethingElse () : void
	{method} +doSomethingWithParameter ( paramString1 : String ) : void
	{method} +doSomethingWithReturnValue () : String
}

interface de.elnarion.test.domain.t0001.BaseInterface {
	{method}  {abstract} +doSomething () : void
	{method}  {abstract} +doSomethingWithParameter ( paramString1 : String ) : void
	{method}  {abstract} +doSomethingWithReturnValue () : String
}

class de.elnarion.test.domain.t0001.ChildA {
}

class de.elnarion.test.domain.t0001.ChildB {
}

class de.elnarion.test.domain.t0001.Util {
}

de.elnarion.test.domain.t0001.BaseAbstractClass ..|>  de.elnarion.test.domain.t0001.BaseInterface
de.elnarion.test.domain.t0001.ChildA --|>  de.elnarion.test.domain.t0001.BaseAbstractClass
de.elnarion.test.domain.t0001.ChildB -->  de.elnarion.test.domain.t0001.Util : util
de.elnarion.test.domain.t0001.ChildB --|>  de.elnarion.test.domain.t0001.BaseAbstractClass

hide de.elnarion.test.domain.ChildB

@enduml