Class Locations
java.lang.Object
com.tngtech.archunit.core.importer.Locations
Represents a set of
locations
of Java class files. Also offers methods to derive concrete locations (i.e. URIs) from
higher level concepts like packages or the classpath.-
Method Summary
Modifier and TypeMethodDescriptionDirectly converts the passed URLs tolocations
.Set oflocations
where the class file of the supplied class can be found.
Note that this is really a set, since the same (or in bad cases a different version of the same) class might be found within the classpath several times.Alllocations
in the classpath that match the supplied package.
-
Method Details
-
of
Directly converts the passed URLs tolocations
. URLs can be of class files as well as directories. They can also be JAR URLs of class files (e.g.jar:file:///some.jar!/some/Example.class
) or folders within JAR files. -
ofPackage
Alllocations
in the classpath that match the supplied package.- Parameters:
pkg
- the package to look for within the classpath- Returns:
Locations
of all paths that match the supplied package
-
ofClass
Set oflocations
where the class file of the supplied class can be found.
Note that this is really a set, since the same (or in bad cases a different version of the same) class might be found within the classpath several times. -
inClassPath
- Returns:
- All classes that can be found within the classpath. Note that ArchUnit does not distinguish between the classpath and the modulepath, thus for Java >= 9 all locations of class files from the modulepath with be returned as well.
-