Class ApplicationModuleSource
java.lang.Object
org.springframework.modulith.core.ApplicationModuleSource
The source of an
ApplicationModule
. Essentially a JavaPackage
and associated naming strategy for the
module. This will be used when constructing sources from a base package and an
ApplicationModuleDetectionStrategy
so that the names of the module to be created for the detected packages
become the trailing name underneath the base package. For example, scanning from com.acme
, an
ApplicationModule
located in com.acme.foo.bar
would be named foo.bar
.- Since:
- 1.3
- Author:
- Oliver Drotbohm
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static interface
An intermediate abstraction to detect both theApplicationModuleIdentifier
and potentially nested module declarations for theJavaPackage
s returned from the first pass of module detection. -
Method Summary
Modifier and TypeMethodDescriptionboolean
(package private) static ApplicationModuleSource
from
(JavaPackage pkg, String identifier) Creates a newApplicationModuleSource
for the givenJavaPackage
and name.static Stream<ApplicationModuleSource>
from
(JavaPackage rootPackage, ApplicationModuleDetectionStrategy strategy, boolean fullyQualifiedModuleNames) Returns aStream
ofApplicationModuleSource
s by applying the givenApplicationModuleDetectionStrategy
to the given base package.Returns theApplicationModuleIdentifier
to be used for the module.Returns the base package for the module.int
hashCode()
toString()
-
Method Details
-
from
public static Stream<ApplicationModuleSource> from(JavaPackage rootPackage, ApplicationModuleDetectionStrategy strategy, boolean fullyQualifiedModuleNames) Returns aStream
ofApplicationModuleSource
s by applying the givenApplicationModuleDetectionStrategy
to the given base package.- Parameters:
rootPackage
- must not be null.strategy
- must not be null.fullyQualifiedModuleNames
- whether to use fully qualified module names.- Returns:
- will never be null.
-
from
Creates a newApplicationModuleSource
for the givenJavaPackage
and name.- Parameters:
pkg
- must not be null.identifier
- must not be null or empty.- Returns:
- will never be null.
-
getModuleBasePackage
Returns the base package for the module.- Returns:
- will never be null.
-
getIdentifier
Returns theApplicationModuleIdentifier
to be used for the module.- Returns:
- will never be null.
-
equals
-
hashCode
public int hashCode() -
toString
-