0

I've implemented some custom runtime method annotation. Now I want to check (preferably in compile-time) that all methods which were marked with my newly implemented annotation are static and have only one serializable argument. How can I archive it in Java 7?

1 Answer 1

1

You can use annotation processing to do that. Run javac with proc, processor and processorpath option and implement a Processor that does all the checking you want.

Note that you can't enforce others to use these options, so you should still include appropriate runtime checking.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.