blob: 3ae05e698c18ed33007327c2dba98ea39a62c4fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
<chapter id="reflection" xreflabel="Reflection">
<title>New Reflection Interfaces</title>
<para>
AspectJ 5 provides a full set of reflection APIs analogous to the
<literal>java.lang.reflect</literal> package, but fully aware of the
AspectJ type system. See the javadoc for the runtime and tools APIs
for the full details. The reflection APIs are only supported when
running under Java 5 and for code compiled by the AspectJ 5 compiler
at target level 1.5.
</para>
<sect1 id="reflection_api">
<title>Using AjTypeSystem</title>
<para>
The starting point for using the reflection apis is
<literal>org.aspectj.lang.reflect.AjTypeSystem</literal> which
provides the method <literal>getAjType(Class)</literal> which will
return the <literal>AjType</literal> corresponding to a given
Java class. The <literal>AjType</literal> interface corresponds to
<literal>java.lang.Class</literal> and gives you access to all of the
method, field, constructor, and also pointcut, advice, declare
statement and inter-type declaration members in the type.
</para>
</sect1>
</chapter>
|