Skip to content

Commit 549830b

Browse files
authored
Added trait example link to the documentation (#384)
1 parent 109083b commit 549830b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/concepts-and-explanations/traits.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public interface Trait<T extends Tree> {
4646

4747
## A real-world example: the Annotated trait
4848

49+
The [src/main/java/com/yourorg/FindSpringBeans.java recipe](https://github.com/moderneinc/rewrite-recipe-starter/blob/main/src/main/java/com/yourorg/FindSpringBeans.java) in the recipe starter project is a good example of how to use traits.
50+
4951
To get a better idea of why you may want to use or create a trait, let's consider a real-world example: Java annotations. In Java, you can annotate methods and pass in a `String` to said annotation. _Syntactically_, this can be done in a few ways while keeping the same _semantic_ meaning. For example, you could write:
5052

5153
```java

0 commit comments

Comments
 (0)