blob: 021ea8d43cbf21f1b9151b32645ee1e7693f7616 [file] [log] [blame]
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Aspects</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM Programming Guide"><link rel="up" href="quick.html" title="Appendix A. AspectJ Quick Reference"><link rel="previous" href="quick-other.html" title="Other declarations"><link rel="next" href="semantics.html" title="Appendix B. Language Semantics"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Aspects</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="quick-other.html">Prev</a>&nbsp;</td><th width="60%" align="center">Appendix A. AspectJ Quick Reference</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="semantics.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="quick-aspectAssociations"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="quick-aspectAssociations"></a>Aspects</h2></div></div><p>
Each aspect is of the form
<blockquote class="blockquote"><tt>
[ privileged ] <i><tt>Modifiers</tt></i>
aspect <i><tt>Id</tt></i>
[ extends <i><tt>Type</tt></i> ]
[ implements <i><tt>TypeList</tt></i> ]
[ <i><tt>PerClause</tt></i> ]
{ <i><tt>Body</tt></i> }
</tt></blockquote>
where <i><tt>PerClause</tt></i> defines how the aspect is
instantiated and associated (<tt>issingleton()</tt> by
default):
</p><div class="informaltable" id="d0e4416"><a name="d0e4416"></a><table border="0"><colgroup><col><col><col></colgroup><thead><tr><th align="left">PerClause</th><th align="left">Description</th><th align="left">Accessor</th></tr></thead><tbody valign="top"><tr><td>
[ <tt>issingleton()</tt> ]
</td><td>
One instance of the aspect is made. This is
the default.
</td><td><tt>aspectOf()</tt> at all join points
</td></tr><tr><td><tt>perthis(<i><tt>Pointcut</tt></i>)</tt></td><td>
An instance is associated with each object that is the
currently executing object at any join point in
<i><tt>Pointcut</tt></i>.
</td><td><tt>aspectOf(Object)</tt> at all join points
</td></tr><tr><td><tt>pertarget(<i><tt>Pointcut</tt></i>)</tt></td><td>
An instance is associated with each object that is the
target object at any join point in
<i><tt>Pointcut</tt></i>.
</td><td><tt>aspectOf(Object)</tt> at all join points
</td></tr><tr><td><tt>percflow(<i><tt>Pointcut</tt></i>)</tt></td><td>
The aspect is defined for each entrance to the control flow of
the join points defined by <i><tt>Pointcut</tt></i>. </td><td><tt>aspectOf()</tt> at join points in
<tt>cflow(<i><tt>Pointcut</tt></i>)</tt></td></tr><tr><td><tt>percflowbelow(<i><tt>Pointcut</tt></i>)</tt></td><td>
The aspect is defined for each entrance to the control flow
below the join points defined by <i><tt>Pointcut</tt></i>.
</td><td><tt>aspectOf()</tt> at join points in
<tt>cflowbelow(<i><tt>Pointcut</tt></i>)</tt></td></tr></tbody></table></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="quick-other.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="semantics.html">Next</a></td></tr><tr><td width="40%" align="left">Other declarations&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="quick.html">Up</a></td><td width="40%" align="right">&nbsp;Appendix B. Language Semantics</td></tr></table></div></body></html>