whitelistRegexp
Description
This configuration parameter defines a regular expression for all classes which should be part of the generated diagram text. It can not be combined with a blacklist regular expression or a list of packages to scan for. Therefore it can only be added to the constructor of the PlantUMLClassDiagramConfigBuilder class as a single parameter.
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 which match the regular expression org\.apache\.commons\.io.*FileAl.* and 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>
<whitelistRegexp>org\.apache\.commons\.io.*FileAl.*</whitelistRegexp>
<hideFields>true</hideFields>
<hideMethods>true</hideMethods>
</configuration>
</execution>
</executions>
</plugin>
which is rendered this way:
and produces this PlantUML diagram text:
@startuml
interface org.apache.commons.io.monitor.FileAlterationListener {
{method} {abstract} +onDirectoryChange ( paramFile1 : java.io.File ) : void
{method} {abstract} +onDirectoryCreate ( paramFile1 : java.io.File ) : void
{method} {abstract} +onDirectoryDelete ( paramFile1 : java.io.File ) : void
{method} {abstract} +onFileChange ( paramFile1 : java.io.File ) : void
{method} {abstract} +onFileCreate ( paramFile1 : java.io.File ) : void
{method} {abstract} +onFileDelete ( paramFile1 : java.io.File ) : void
{method} {abstract} +onStart ( paramFileAlterationObserver1 : org.apache.commons.io.monitor.FileAlterationObserver ) : void
{method} {abstract} +onStop ( paramFileAlterationObserver1 : org.apache.commons.io.monitor.FileAlterationObserver ) : void
}
class org.apache.commons.io.monitor.FileAlterationListenerAdaptor {
{method} +onDirectoryChange ( paramFile1 : java.io.File ) : void
{method} +onDirectoryCreate ( paramFile1 : java.io.File ) : void
{method} +onDirectoryDelete ( paramFile1 : java.io.File ) : void
{method} +onFileChange ( paramFile1 : java.io.File ) : void
{method} +onFileCreate ( paramFile1 : java.io.File ) : void
{method} +onFileDelete ( paramFile1 : java.io.File ) : void
{method} +onStart ( paramFileAlterationObserver1 : org.apache.commons.io.monitor.FileAlterationObserver ) : void
{method} +onStop ( paramFileAlterationObserver1 : org.apache.commons.io.monitor.FileAlterationObserver ) : void
}
class org.apache.commons.io.monitor.FileAlterationMonitor {
{field} {static} -EMPTY_ARRAY : [Lorg.apache.commons.io.monitor.FileAlterationObserver;
{field} -intervalMillis : long
{field} -running : boolean
{field} -thread : Thread
{field} -threadFactory : java.util.concurrent.ThreadFactory
{method} +addObserver ( paramFileAlterationObserver1 : org.apache.commons.io.monitor.FileAlterationObserver ) : void
{method} +getInterval () : long
{method} +removeObserver ( paramFileAlterationObserver1 : org.apache.commons.io.monitor.FileAlterationObserver ) : void
{method} +run () : void
{method} +start () : void <<synchronized>>
{method} +stop () : void <<synchronized>>
{method} +stop ( paramlong1 : long ) : void <<synchronized>>
}
class org.apache.commons.io.monitor.FileAlterationObserver {
{field} -comparator : java.util.Comparator
{field} -fileFilter : java.io.FileFilter
{field} -rootEntry : org.apache.commons.io.monitor.FileEntry
{field} {static} -serialVersionUID : long
{method} +addListener ( paramFileAlterationListener1 : org.apache.commons.io.monitor.FileAlterationListener ) : void
{method} -checkAndFire ( paramFileEntry1 : org.apache.commons.io.monitor.FileEntry , paramFileEntry;2 : [Lorg.apache.commons.io.monitor.FileEntry; , paramFile;3 : [Ljava.io.File; ) : void
{method} +checkAndNotify () : void
{method} -createFileEntry ( paramFileEntry1 : org.apache.commons.io.monitor.FileEntry , paramFile2 : java.io.File ) : org.apache.commons.io.monitor.FileEntry
{method} +destroy () : void
{method} -fireOnChange ( paramFileEntry1 : org.apache.commons.io.monitor.FileEntry , paramFile2 : java.io.File ) : void
{method} -fireOnCreate ( paramFileEntry1 : org.apache.commons.io.monitor.FileEntry ) : void
{method} -fireOnDelete ( paramFileEntry1 : org.apache.commons.io.monitor.FileEntry ) : void
{method} +getDirectory () : java.io.File
{method} +initialize () : void
{method} -listFileEntries ( paramFile1 : java.io.File , paramFileEntry2 : org.apache.commons.io.monitor.FileEntry ) : [Lorg.apache.commons.io.monitor.FileEntry;
{method} -listFiles ( paramFile1 : java.io.File ) : [Ljava.io.File;
{method} +removeListener ( paramFileAlterationListener1 : org.apache.commons.io.monitor.FileAlterationListener ) : void
{method} -sort ( paramFile;1 : [Ljava.io.File; ) : [Ljava.io.File;
{method} {static} -toComparator ( paramIOCase1 : org.apache.commons.io.IOCase ) : java.util.Comparator
{method} +toString () : String
}
org.apache.commons.io.monitor.FileAlterationListenerAdaptor ..|> org.apache.commons.io.monitor.FileAlterationListener
org.apache.commons.io.monitor.FileAlterationMonitor "1" o-- "0..*" org.apache.commons.io.monitor.FileAlterationObserver : observers
org.apache.commons.io.monitor.FileAlterationObserver "1" o-- "0..*" org.apache.commons.io.monitor.FileAlterationListener : listeners
hide fields
hide methods
@enduml