public interface ArchRule extends CanBeEvaluated, CanOverrideDescription<ArchRule>
JavaClass
).
To define a rule, use one of the factory methods within ArchRuleDefinition
, for example
ArchRule rule = ArchRuleDefinition.noClasses()
.that()
.resideInAPackage("..svc..")
.should()
.accessClassesThat()
.resideInAPackage("..ui..")
;
rule.check(importedJavaClasses);
ArchRuleDefinition.all(ClassesTransformer)
, where
ClassesTransformer
defines how the type of objects can be created from imported JavaClasses
.
E.g. if you want to define a rule on all imported methods you could specify a transformer to retrieve methods
from classes, or if you're interested in slices of packages, the input transformer would specify how to transform
the imported classes to those slices to run an ArchCondition
against.Slices.Transformer
Modifier and Type | Interface and Description |
---|---|
static class |
ArchRule.Assertions |
static class |
ArchRule.Factory |
static interface |
ArchRule.Transformation |
Modifier and Type | Method and Description |
---|---|
ArchRule |
because(java.lang.String reason) |
void |
check(JavaClasses classes) |
evaluate
getDescription
as
void check(JavaClasses classes)
ArchRule because(java.lang.String reason)