What have you already tried? Please share the code of your custom rule, and from there, we will try to help you. Note that this case should be pretty trivial once registered to METHOD trees… There is even multiple rules of the official examples doing similar things on top of methods. Please have a look here:
Now, if you just need just to validate names according to regex, there is even of the template rule already available in SonarJava: See squid:S100
I haven’t tried anything to get all method names.
I want to check whether default methods are implemented or not. For example,
If anyone using the api proxy they have to implement some methods like preFilter,errorFilter. As per my knowledge using visitMethod(), we can iterate over each method.
But when i write any validations it will raise issue on each method if it is not validated. Instead of iterating each method i want to get all methods/method names declared inside class. So, I can validate all at a time and i can flag the issue.