Class ApplicationModule
java.lang.Object
org.springframework.modulith.core.ApplicationModule
An application module.
- Author:
- Oliver Drotbohm
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static class
A collection wrapper forApplicationModule.DeclaredDependency
instances.(package private) static class
(package private) static class
-
Constructor Summary
ConstructorDescriptionApplicationModule
(JavaPackage basePackage, boolean useFullyQualifiedModuleNames) Creates a newApplicationModule
for the given base package and whether to use fully-qualified module names. -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(com.tngtech.archunit.core.domain.JavaClass type) boolean
(package private) boolean
Returns whether the given module contains a type with the given simple or fully qualified name.detectDependencies
(ApplicationModules modules) boolean
List<com.tngtech.archunit.core.domain.JavaClass>
Returns all types that are considered aggregate roots.getArchitecturallyEvidentType
(Class<?> type) Returns theArchitecturallyEvidentType
for the given type.Returns the module's base package.getBootstrapBasePackages
(ApplicationModules modules, DependencyDepth depth) Returns allJavaPackage
for the current module including the ones by its dependencies.Returns all modules that contain types which the types of the current module depend on.getBootstrapDependencies
(ApplicationModules modules, DependencyDepth depth) (package private) ApplicationModule.DeclaredDependencies
Returns all declared module dependencies, either explicitly declared or defined as shared on the givenApplicationModules
instance.getDependencies
(ApplicationModules modules, DependencyType... type) ReturnsApplicationModule.DeclaredDependencies
of the currentApplicationModule
.Returns the name of theApplicationModule
for display purposes.List<com.tngtech.archunit.core.domain.JavaClass>
getEventsListenedTo
(ApplicationModules modules) Returns all event types the current module exposes an event listener for.getName()
Returns the logical name of the module.Returns allNamedInterfaces
exposed by the module.Returns allEventType
s published by the module.Returns allSpringBean
s contained in the module.(package private) Classes
Optional<com.tngtech.archunit.core.domain.JavaClass>
Returns theJavaClass
for the given candidate simple of fully-qualified type name.List<com.tngtech.archunit.core.domain.JavaClass>
Returns all value types contained in the module.int
hashCode()
boolean
isExposed
(com.tngtech.archunit.core.domain.JavaClass type) Returns whether the givenJavaClass
is exposed by the current module, i.e.toString()
toString
(ApplicationModules modules) void
verifyDependencies
(ApplicationModules modules)
-
Constructor Details
-
ApplicationModule
ApplicationModule(JavaPackage basePackage, boolean useFullyQualifiedModuleNames) Creates a newApplicationModule
for the given base package and whether to use fully-qualified module names.- Parameters:
basePackage
- must not be null.useFullyQualifiedModuleNames
-
-
-
Method Details
-
getBasePackage
Returns the module's base package.- Returns:
- the basePackage
-
getNamedInterfaces
Returns allNamedInterfaces
exposed by the module.- Returns:
- the namedInterfaces will never be null.
-
getName
Returns the logical name of the module.- Returns:
- will never be null or empty.
-
getDisplayName
Returns the name of theApplicationModule
for display purposes.- Returns:
- will never be null or empty.
-
getDependencies
public ApplicationModuleDependencies getDependencies(ApplicationModules modules, DependencyType... type) ReturnsApplicationModule.DeclaredDependencies
of the currentApplicationModule
.- Parameters:
modules
- must not be null.type
- must not be null.- Returns:
- will never be null.
-
getEventsListenedTo
public List<com.tngtech.archunit.core.domain.JavaClass> getEventsListenedTo(ApplicationModules modules) Returns all event types the current module exposes an event listener for.- Parameters:
modules
- must not be null.- Returns:
-
getPublishedEvents
Returns allEventType
s published by the module.- Returns:
- will never be null.
-
getValueTypes
Returns all value types contained in the module.- Returns:
- will never be null.
-
getAggregateRoots
Returns all types that are considered aggregate roots.- Returns:
- will never be null.
-
getBootstrapDependencies
Returns all modules that contain types which the types of the current module depend on.- Parameters:
modules
- must not be null.- Returns:
-
getBootstrapDependencies
public Stream<ApplicationModule> getBootstrapDependencies(ApplicationModules modules, DependencyDepth depth) -
getBootstrapBasePackages
public Stream<JavaPackage> getBootstrapBasePackages(ApplicationModules modules, DependencyDepth depth) Returns allJavaPackage
for the current module including the ones by its dependencies.- Parameters:
modules
- must not be null.depth
- must not be null.- Returns:
-
getSpringBeans
Returns allSpringBean
s contained in the module.- Returns:
- will never be null.
-
getArchitecturallyEvidentType
Returns theArchitecturallyEvidentType
for the given type.- Parameters:
type
- must not be null.- Returns:
- will never be null.
- Throws:
IllegalArgumentException
- if the given type is not a module type.
-
contains
public boolean contains(com.tngtech.archunit.core.domain.JavaClass type) -
contains
-
getType
Returns theJavaClass
for the given candidate simple of fully-qualified type name.- Parameters:
candidate
- must not be null or empty.- Returns:
- will never be null.
-
isExposed
public boolean isExposed(com.tngtech.archunit.core.domain.JavaClass type) Returns whether the givenJavaClass
is exposed by the current module, i.e. whether it's part of any of the module's named interfaces.- Parameters:
type
- must not be null.- Returns:
-
verifyDependencies
-
detectDependencies
-
toString
-
toString
-
getSpringBeansInternal
Classes getSpringBeansInternal() -
getDeclaredDependencies
Returns all declared module dependencies, either explicitly declared or defined as shared on the givenApplicationModules
instance.- Parameters:
modules
- must not be null.- Returns:
-
contains
Returns whether the given module contains a type with the given simple or fully qualified name.- Parameters:
candidate
- must not be null or empty.- Returns:
-
equals
-
hashCode
public int hashCode()
-