Class ModuleDependencyScope
java.lang.Object
com.tngtech.archunit.library.modules.syntax.ModuleDependencyScope
- All Implemented Interfaces:
HasDescription
@PublicAPI(usage=ACCESS,
state=EXPERIMENTAL)
public final class ModuleDependencyScope
extends Object
implements HasDescription
Used to specify which dependencies should be checked by the respective
ArchRule. Possible options are:
-
Method Summary
Modifier and TypeMethodDescriptionstatic ModuleDependencyScopeConsiders all dependencies of every imported class, including basic Java classes likeObject.static ModuleDependencyScopeConsiders only dependencies of the imported classes between two modules.static ModuleDependencyScopeconsideringOnlyDependenciesInAnyPackage(String packageIdentifier, String... furtherPackageIdentifiers) Considers only dependencies of imported classes that target packages matching the given thepackage identifiers.
-
Method Details
-
getDescription
- Specified by:
getDescriptionin interfaceHasDescription
-
consideringAllDependencies
@PublicAPI(usage=ACCESS, state=EXPERIMENTAL) public static ModuleDependencyScope consideringAllDependencies()Considers all dependencies of every imported class, including basic Java classes likeObject. -
consideringOnlyDependenciesBetweenModules
@PublicAPI(usage=ACCESS, state=EXPERIMENTAL) public static ModuleDependencyScope consideringOnlyDependenciesBetweenModules()Considers only dependencies of the imported classes between two modules. I.e. origin and target classes of the dependency must be contained within modules under test to be considered. This makes it easy to ignore dependencies to irrelevant classes likeObject, but bears the danger of missing dependencies to classes that are falsely not covered by the declared module structure. -
consideringOnlyDependenciesInAnyPackage
@PublicAPI(usage=ACCESS, state=EXPERIMENTAL) public static ModuleDependencyScope consideringOnlyDependenciesInAnyPackage(String packageIdentifier, String... furtherPackageIdentifiers) Considers only dependencies of imported classes that target packages matching the given thepackage identifiers. This can for example be used to limit checked dependencies to those contained in the own project, e.g. 'com.myapp..'.
Note that module dependencies, i.e. dependencies between two modules, will never be filtered, so thisModuleDependencyScopewill never limit the amount of considered dependencies more thanconsideringOnlyDependenciesBetweenModules().
-