r/java • u/TheMrMilchmann • Jun 05 '26
Introducing opt-in requirements for Java APIs
https://osmerion.github.io/OptIn/blog/welcome
49
Upvotes
r/java • u/TheMrMilchmann • Jun 05 '26
View all comments
Show parent comment
1
u/TheMrMilchmann Jun 05 '26
This approach is significantly more flexible than @API Guardian: Instead of having a single annotation, library authors are encouraged to declare custom requirement markers. For example, one might have a UI library with an
@ExperimentalTableApiand an@ExperimentalWebViewApi.API users can choose to opt in to the markers for the entire compilation or specific scopes and do this differently for each marker.