-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support to traverse
JavaType
signature
At the moment, handling `JavaType`s is not convenient, because there are many different subtypes. And effectively the only way to handle those is a chain of `instanceof` checks with individual handling for each type. We can make this more convenient by adding a visitor pattern API that allows to simply define what to do on every partial type encountered in the signature (i.e. what to do when a parameterized type is encountered, what to do when each actual type argument of the parameterized type is encountered, and so on). As a benefit, we can use this API in the next step to fix the infinite recursion problem we have for the `getAllRawTypes()` method at the moment. Because, there we haven't handled the case where type variables are defined recursively. Adding this visitor pattern API we can solve this problem in a generic way once at the infrastructure level, i.e. implement the traversal correctly once and utilize it in more specific use cases. Signed-off-by: Peter Gafert <peter.gafert@archunit.org>
- Loading branch information
1 parent
99e5dae
commit 8456198
Showing
7 changed files
with
640 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.