There are some uses with this with regard to
aspect-oriented programming; see
aspectj for example.
The idea with aspect-oriented programming is that you have rules, such as "do this at the beginning of every method", or "do this before and after all methods in this class" etc. A tool then automatically finds the methods that match the rule and inserts code there (via byte code manipulation) to perform the actions that you want to do.
For example, you could have a rule "write a log statement at entry and exit of every public method in this class"; aspectj would find all the public methods in the class and automatically add a log statement to the compiled code for you.