Package org.jmolecules.archunit
Class JMoleculesArchitectureRules.StereotypeLookup
java.lang.Object
org.jmolecules.archunit.JMoleculesArchitectureRules.StereotypeLookup
- Enclosing class:
- JMoleculesArchitectureRules
A strategy how to look up stereotypes for the classes to be analyzed. Can either be on the types themselves
including a package-level assignment (via
defaultLookup()) or via a marker type that acts as replacement
for the package-level lookup.- Since:
- 0.22
- Author:
- Oliver Drotbohm
-
Method Summary
Modifier and TypeMethodDescriptionCreates a defaultJMoleculesArchitectureRules.StereotypeLookup, which means it for each type, it will try to find the annotation on the type itself or any meta annotations and falls back to traversing the package annotations.onMarkerType(String name) Creates aJMoleculesArchitectureRules.StereotypeLookuptrying to find the stereotype annotation on a marker type located in the reference type's package or parent package.onMarkerTypeName(Class<?> type) Creates aJMoleculesArchitectureRules.StereotypeLookuptrying to find the stereotype annotation on marker types with the same simple name as the given one located in the reference type's package or parent package.Configures theJMoleculesArchitectureRules.StereotypeLookupto also look for package-based stereotypes in parent packages.
-
Method Details
-
defaultLookup
Creates a defaultJMoleculesArchitectureRules.StereotypeLookup, which means it for each type, it will try to find the annotation on the type itself or any meta annotations and falls back to traversing the package annotations.- Returns:
- will never be null.
-
onMarkerType
Creates aJMoleculesArchitectureRules.StereotypeLookuptrying to find the stereotype annotation on a marker type located in the reference type's package or parent package.- Parameters:
name- will never be null or empty.- Returns:
- will never be null.
-
onMarkerTypeName
Creates aJMoleculesArchitectureRules.StereotypeLookuptrying to find the stereotype annotation on marker types with the same simple name as the given one located in the reference type's package or parent package.- Parameters:
type- will never be null or empty.- Returns:
- will never be null.
-
withParentPackageTraversal
Configures theJMoleculesArchitectureRules.StereotypeLookupto also look for package-based stereotypes in parent packages. Defaults to false to be able to freely reassign stereotypes to types in nested packages.- Returns:
- will never be null.
- Since:
- 0.30
-