mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-09-13 15:45:38 +02:00
fix for bugzilla bug 72379:
static aspects not well explained
This commit is contained in:
parent
a7d57dab76
commit
acaeeaf485
@ -888,7 +888,7 @@ aspect PointBoundsChecking {
|
||||
</para>
|
||||
|
||||
<programlisting><![CDATA[
|
||||
static aspect RegistrationProtection {
|
||||
aspect RegistrationProtection {
|
||||
|
||||
pointcut register(): call(void Registry.register(FigureElement));
|
||||
|
||||
@ -920,7 +920,7 @@ static aspect RegistrationProtection {
|
||||
</para>
|
||||
|
||||
<programlisting><![CDATA[
|
||||
static aspect RegistrationProtection {
|
||||
aspect RegistrationProtection {
|
||||
|
||||
pointcut register(): call(void Registry.register(FigureElement));
|
||||
pointcut canRegister(): withincode(static * FigureElement.make*(..));
|
||||
|
@ -2620,23 +2620,54 @@ ModifiersPattern =
|
||||
|
||||
<para>
|
||||
An aspect is a crosscutting type defined by the <literal>aspect</literal>
|
||||
declaration. The <literal>aspect</literal> declaration is similar to the
|
||||
<literal>class</literal> declaration in that it defines a type and an
|
||||
implementation for that type. It differs in that the type and
|
||||
implementation can cut across other types (including those defined by
|
||||
other aspect declarations), and that it may not be directly instantiated
|
||||
with a new expression, with cloning, or with serialization. Aspects may
|
||||
have one constructor definition, but if so it must be of a constructor
|
||||
taking no arguments and throwing no checked exceptions.
|
||||
declaration.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Aspects may be defined either at the package level, or as a static nested
|
||||
aspect -- that is, a static member of a class, interface, or aspect. If it
|
||||
is not at the package level, the aspect <emphasis>must</emphasis> be
|
||||
defined with the static keyword. Local and anonymous aspects are not
|
||||
allowed.
|
||||
</para>
|
||||
<sect2>
|
||||
<title>Aspect Declaration</title>
|
||||
|
||||
<para>
|
||||
The <literal>aspect</literal> declaration is similar to the
|
||||
<literal>class</literal> declaration in that it defines a type and an
|
||||
implementation for that type. It differs in a number of
|
||||
ways:
|
||||
</para>
|
||||
|
||||
<sect3>
|
||||
<title>Aspect implementation can cut across other types</title>
|
||||
|
||||
<para> In addition to normal Java class declarations such as
|
||||
methods and fields, aspect declarations can include AspectJ
|
||||
declarations such as advice, pointcuts, and inter-type
|
||||
declarations. Thus, aspects contain implementation
|
||||
declarations that can can cut across other types (including those defined by
|
||||
other aspect declarations).
|
||||
</para>
|
||||
</sect3>
|
||||
|
||||
<sect3>
|
||||
<title>Aspects are not directly instantiated</title>
|
||||
|
||||
<para> Aspects are not directly instantiated with a new
|
||||
expression, with cloning, or with serialization. Aspects may
|
||||
have one constructor definition, but if so it must be of a
|
||||
constructor taking no arguments and throwing no checked
|
||||
exceptions.
|
||||
</para>
|
||||
</sect3>
|
||||
|
||||
<sect3>
|
||||
<title>Nested aspects must be <literal>static</literal></title>
|
||||
|
||||
<para>
|
||||
Aspects may be defined either at the package level, or as a static nested
|
||||
aspect -- that is, a static member of a class, interface, or aspect. If it
|
||||
is not at the package level, the aspect <emphasis>must</emphasis> be
|
||||
defined with the static keyword. Local and anonymous aspects are not
|
||||
allowed.
|
||||
</para>
|
||||
</sect3>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>Aspect Extension</title>
|
||||
|
Loading…
Reference in New Issue
Block a user