Is there any Java annotation enabling to intercept the access (read or write) to a public class attribute ?
This would enable to inject logic as you would with getters and setters, without the need of making them when it’s not necessary.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no built in annotations to do this, but you could add your own. However, Using aspect orientated programming may be what you have in mind. e.g. AspectJ