1616package com .tngtech .archunit .library .dependencies ;
1717
1818import com .tngtech .archunit .PublicAPI ;
19+ import com .tngtech .archunit .core .domain .PackageMatcher ;
1920import com .tngtech .archunit .lang .ArchRule ;
2021import com .tngtech .archunit .lang .Priority ;
2122import com .tngtech .archunit .library .dependencies .syntax .GivenSlices ;
2425import static com .tngtech .archunit .PublicAPI .Usage .ACCESS ;
2526
2627/**
27- * Allows to specify {@link ArchRule ArchRules} for "slices" of a code base. A slice is conceptually
28- * a cut through a code base according to business logic. Take for example
28+ * Allows to specify {@link ArchRule ArchRules} for "slices" of a code base.
29+ * A slice is conceptually a cut through a code base according to business logic.
30+ * <h6>Example</h6>
2931 * <pre><code>
3032 * com.mycompany.myapp.order
3133 * com.mycompany.myapp.customer
3234 * com.mycompany.myapp.user
3335 * com.mycompany.myapp.authorization
3436 * </code></pre>
35- * The top level packages under 'myapp' are composed according to different domain aspects. It is
36- * good practice, to keep such packages free of cycles, which is one capability that this class
37- * provides.<br>
38- * Consider
39- * <pre><code>
40- * {@link #slices() slices()}.{@link Slices#matching(String) matching("..myapp.(*)..")}.{@link GivenSlices#should() should()}.{@link SlicesShould#beFreeOfCycles() beFreeOfCycles()}
41- * </code></pre>
42- * Then this rule will assert, that the four slices of 'myapp' are free of cycles.
37+ * The top level packages under {@code myapp} are composed according to different domain aspects.
38+ * It is good practice to keep such packages free of cycles,
39+ * which can be tested with the following rule:
40+ * <pre><code>{@link #slices() slices()}.{@link Creator#matching(String) matching("..myapp.(*)..")}.{@link GivenSlices#should() should()}.{@link SlicesShould#beFreeOfCycles() beFreeOfCycles()}</code></pre>
41+ * This rule asserts that the four slices of {@code myapp} are free of cycles.
4342 */
4443@ PublicAPI (usage = ACCESS )
4544public final class SlicesRuleDefinition {
@@ -60,6 +59,8 @@ private Creator() {
6059 }
6160
6261 /**
62+ * defines a {@link SlicesRuleDefinition "slices" rule}
63+ * based on a {@link PackageMatcher package identifier} with capturing groups
6364 * @see Slices#matching(String)
6465 */
6566 @ PublicAPI (usage = ACCESS )
@@ -68,6 +69,8 @@ public GivenSlices matching(String packageIdentifier) {
6869 }
6970
7071 /**
72+ * defines a {@link SlicesRuleDefinition "slices" rule}
73+ * based on a {@link PackageMatcher package identifier} with capturing groups
7174 * @see Slices#matching(String)
7275 */
7376 @ PublicAPI (usage = ACCESS )
@@ -76,6 +79,8 @@ public GivenSlices matching(String packageIdentifier, Priority priority) {
7679 }
7780
7881 /**
82+ * defines a {@link SlicesRuleDefinition "slices" rule}
83+ * based on an explicit {@link SliceAssignment}
7984 * @see Slices#assignedFrom(SliceAssignment)
8085 */
8186 @ PublicAPI (usage = ACCESS )
@@ -84,6 +89,8 @@ public GivenSlices assignedFrom(SliceAssignment assignment) {
8489 }
8590
8691 /**
92+ * defines a {@link SlicesRuleDefinition "slices" rule}
93+ * based on an explicit {@link SliceAssignment}
8794 * @see Slices#assignedFrom(SliceAssignment)
8895 */
8996 @ PublicAPI (usage = ACCESS )
0 commit comments