blacklistRegexp
Description
This parameter can only be specified together with a list of packages to scan for. This is because otherwise the number of classes would otherwise be to large.
If this parameter is specified it is used as a filter for all classes found in the defined packages to scan and used via the String.matches method of Java.
Default value
There is no default value for the blacklist regular expression. It is only used when specified and not empty.
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 "org.apache.commons.io.monitor" without all classes matching the regular expression .*FileEn.* should be generated as class diagram. This is similar to the JUnit-tests of the PlantUML generator utility:
<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>org.apache.commons.io.monitor</scanPackage>
</scanPackages>
<blacklistRegexp>.*FileEn.*</blacklistRegexp>
<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