Every join point has a single set of modifiers - these include the standard Java modifiers such as public, private, static, abstract etc., any annotations, and the throws clauses of methods and constructors. These modifiers are the modifiers of the subject of the join point.
The following table defines the join point subject for each kind of join point.
Join Point Kind | Subject |
---|---|
Method call | The method picked out by Java as the static target of the method call. |
Method execution | The method that is executing. |
Constructor call | The constructor being called. |
Constructor execution | The constructor executing. |
Field get | The field being accessed. |
Field set | The field being set. |
Pre-initialization | The first constructor executing in this constructor chain. |
Initialization | The first constructor executing in this constructor chain. |
Static initialization | The type being initialized. |
Handler | The declared type of the exception being handled. |
Advice execution | The advice being executed. |
For example, given the following types
public class X { @Foo protected void doIt() {...} } public class Y extends X { public void doIt() {...} }
Then the modifiers for a call to (Y y) y.doIt() are simply {public}. The modifiers for a call to (X x) x.doIt() are {@Foo,protected}.