maxVisibilityMethods

Description

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

The following options are supported:

  • PUBLIC
    only public methods will be displayed

  • PROTECTED
    only public and protected methods will be displayed

  • PACKAGE_PRIVATE
    only public, protected and package_private methods 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.t0014", 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.t0014</scanPackage>
							</scanPackages>
							<maxVisibilityMethods>PROTECTED</maxVisibilityMethods>
						</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_methods_public_diagram

and produces this PlantUML diagram text:

@startuml

class de.elnarion.test.domain.t0014.Testclass {
	{method} +doSomething4() : void
}

@enduml

Maximum visibility protected

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

0013_max_visibility_methods_protected_diagram

and produces this PlantUML diagram text:

@startuml

class de.elnarion.test.domain.t0014.Testclass {
	{method} #doSomething3() : void
	{method} +doSomething4() : void
}

@enduml

Maximum visibility package private

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

0013_max_visibility_methods_package_private_diagram

and produces this PlantUML diagram text:

@startuml

class de.elnarion.test.domain.t0014.Testclass {
	{method} ~doSomething2() : void
	{method} #doSomething3() : void
	{method} +doSomething4() : void
}

@enduml

Maximum visibility private

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

0013_max_visibility_methods_private_diagram

and produces this PlantUML diagram text:

@startuml

class de.elnarion.test.domain.t0014.Testclass {
	{method} -doSomething1() : void
	{method} ~doSomething2() : void
	{method} #doSomething3() : void
	{method} +doSomething4() : void
}

@enduml