Python-like decorators in Java?
<p>I spend most of my time programming in Python, so forgive me if my approach to this problem is short-sited:</p>

<p>I want to have certain methods of a class require login credentials. Simply, each method should check whether the class variable <code>user</code> is set, and if so, continue, but if not, spit out a "you need to login" message.</p>

<p>In Python, I would just write a decorator to do this. How can I accomplish the same thing in java with as little redundant code as possible?</p>

<p>Thanks!</p>
