Class ClasspathPattern

  • All Implemented Interfaces:
    Iterable<String>, Collection<String>, Set<String>

    public class ClasspathPattern
    extends AbstractSet<String>
    Classpath classes list performs pattern matching of a class name against an internal array of classpath pattern entries. A class pattern is a string of one of the forms:
    • 'org.package.SomeClass' will match a specific class
    • 'org.package.' will match a specific package hierarchy
    • 'org.package.SomeClass$NestedClass ' will match a nested class exactly otherwise. Nested classes are matched by their containing class. (eg. org.example.MyClass matches org.example.MyClass$AnyNestedClass)
    • 'file:///some/location/' - A file system directory from which the class was loaded
    • 'file:///some/location.jar' - The URI of a jar file from which the class was loaded
    • 'jrt:/modulename' - A Java9 module name
    • Any of the above patterns preceded by '-' will exclude rather than include the match.
    When class is initialized from a classpath pattern string, entries in this string should be separated by ':' (semicolon) or ',' (comma).