Class ApplicationModule
java.lang.Object
org.springframework.modulith.core.ApplicationModule
An application module.
- Author:
- Oliver Drotbohm
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classA collection wrapper forApplicationModule.DeclaredDependencyinstances.(package private) static class(package private) static class -
Constructor Summary
ConstructorsConstructorDescriptionApplicationModule(JavaPackage basePackage, boolean useFullyQualifiedModuleNames) Creates a newApplicationModulefor the given base package and whether to use fully-qualified module names. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(com.tngtech.archunit.core.domain.JavaClass type) boolean(package private) booleanReturns whether the given module contains a type with the given simple or fully qualified name.detectDependencies(ApplicationModules modules) booleanList<com.tngtech.archunit.core.domain.JavaClass>Returns all types that are considered aggregate roots.(package private) ApplicationModule.DeclaredDependenciesgetAllowedDependencies(ApplicationModules modules) Returns all allowed module dependencies, either explicitly declared or defined as shared on the givenApplicationModulesinstance.getArchitecturallyEvidentType(Class<?> type) Returns theArchitecturallyEvidentTypefor the given type.Returns the module's base package.getBootstrapBasePackages(ApplicationModules modules, DependencyDepth depth) Returns allJavaPackagefor 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) getDependencies(ApplicationModules modules, DependencyType... type) ReturnsApplicationModule.DeclaredDependenciesof the currentApplicationModule.Returns the name of theApplicationModulefor 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 allNamedInterfacesexposed by the module.Returns allEventTypes published by the module.Returns allSpringBeans contained in the module.(package private) ClassesOptional<com.tngtech.archunit.core.domain.JavaClass>Returns theJavaClassfor the given candidate simple of fully-qualified type name.List<com.tngtech.archunit.core.domain.JavaClass>Returns all value types contained in the module.inthashCode()booleanisExposed(com.tngtech.archunit.core.domain.JavaClass type) Returns whether the givenJavaClassis exposed by the current module, i.e.toString()toString(ApplicationModules modules) voidverifyDependencies(ApplicationModules modules)
-
Constructor Details
-
ApplicationModule
ApplicationModule(JavaPackage basePackage, boolean useFullyQualifiedModuleNames) Creates a newApplicationModulefor 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 allNamedInterfacesexposed 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 theApplicationModulefor display purposes.- Returns:
- will never be null or empty.
-
getDependencies
public ApplicationModuleDependencies getDependencies(ApplicationModules modules, DependencyType... type) ReturnsApplicationModule.DeclaredDependenciesof 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 allEventTypes 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 allJavaPackagefor the current module including the ones by its dependencies.- Parameters:
modules- must not be null.depth- must not be null.- Returns:
-
getSpringBeans
Returns allSpringBeans contained in the module.- Returns:
- will never be null.
-
getArchitecturallyEvidentType
Returns theArchitecturallyEvidentTypefor 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 theJavaClassfor 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 givenJavaClassis 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() -
getAllowedDependencies
Returns all allowed module dependencies, either explicitly declared or defined as shared on the givenApplicationModulesinstance.- 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()
-