Reputation: 53
Is there a way in Java to make an annotation you put before a method to check if a boolean or any variable is defined/a-certain-value and if it's not it disregards the call to the method (no code from the method will be executed)?
Upvotes: 0
Views: 217
Reputation: 3565
Annotations just provide metadata about your code. They cannot directly influence your code without the use of tools such as JUnit. As stated here:
Annotations, a form of metadata, provide data about a program that is not part of the program itself. Annotations have no direct effect on the operation of the code they annotate.
Upvotes: 1