maxVisibilityFields

Description

With this configuration option you can filter out fields from the diagram by their visibility in Java.

The following options are supported:

  • PUBLIC
    only public fields will be displayed

  • PROTECTED
    only public and protected fields will be displayed

  • PACKAGE_PRIVATE
    only public, protected and package_private fields will be displayed

  • PRIVATE
    all fields will be displayed if not removed or ignored by other parameters

Default value

The default value of this configuration option is PRIVATE.

Example

In the following example there are three dependencies in the maven dependency hierarchy which build the classpath for all further generation:

	<dependencies>
		<dependency>
			<groupId>de.elnarion.util</groupId>
			<artifactId>plantuml-generator-util</artifactId>
			<version>@project.version@</version>
			<classifier>tests</classifier>
			<type>test-jar</type>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>2.16.1</version>
		</dependency>
		<dependency>
			<groupId>javax.persistence</groupId>
			<artifactId>javax.persistence-api</artifactId>
			<version>2.2</version>
		</dependency>
	</dependencies>

From this classpath all classes of the package "de.elnarion.test.domain.t0013", which are also used by the JUnit-tests of the PlantUML generator utility, should be generated as class diagram with the following plugin configuration

			<plugin>
				<artifactId>plantuml-generator-maven-plugin</artifactId>
				<groupId>de.elnarion.maven</groupId>
				<version>@project.version@</version>
				<executions>
					<execution>
						<id>generate-simple-diagram</id>
						<goals>
							<goal>generate</goal>
						</goals>
						<phase>generate-test-sources</phase>
						<configuration>
							<outputFilename>testdiagram1.txt</outputFilename>
							<scanPackages>
								<scanPackage>de.elnarion.test.domain.t0013</scanPackage>
							</scanPackages>
							<maxVisibilityFields>PROTECTED</maxVisibilityFields>
						</configuration>
					</execution>
				</executions>
			</plugin>

but their maximum visibility for fields is limited to PROTECTED. How this is rendered and how the generated diagram looks like is shown in the following subchapters.

Maximum visibility public

Here the value is set to PUBLIC which is rendered this way:

0013_max_visibility_fields_public_diagram

and produces this PlantUML diagram text:

@startuml

class de.elnarion.test.domain.t0013.Testclass {
	{field} +test4 : long
	{field} +test5 : long
}

@enduml

Maximum visibility protected

Here the value is set to PROTECTED which is rendered this way:

0013_max_visibility_fields_protected_diagram

and produces this PlantUML diagram text:

@startuml

class de.elnarion.test.domain.t0013.Testclass {
	{field} #test3 : long
	{field} +test4 : long
	{field} +test5 : long
}

@enduml

Maximum visibility package private

Here the value is set to PACKAGE_PRIVATE which is rendered this way:

0013_max_visibility_fields_package_private_diagram

and produces this PlantUML diagram text:

@startuml

class de.elnarion.test.domain.t0013.Testclass {
	{field} ~test2 : long
	{field} #test3 : long
	{field} +test4 : long
	{field} +test5 : long
}

@enduml

Maximum visibility private

Here the value is set to PRIVATE which is rendered this way:

0013_max_visibility_fields_private_diagram

and produces this PlantUML diagram text:

@startuml

class de.elnarion.test.domain.t0013.Testclass {
	{field} -test1 : long
	{field} ~test2 : long
	{field} #test3 : long
	{field} +test4 : long
	{field} +test5 : long
}

@enduml