blob: 14c46e0b3c84b0ccad1b077053de1bb447265359 [file] [log] [blame]
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Chapter 10. New Reflection Interfaces</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 5 Development Kit Developer's Notebook"><link rel="up" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="previous" href="ataspectj-aspectof.html" title="aspectOf() and hasAspect() methods"><link rel="next" href="miscellaneous.html" title="Chapter 11. Other Changes in AspectJ 5"></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">Chapter 10. New Reflection Interfaces</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ataspectj-aspectof.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="miscellaneous.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="reflection"></a>Chapter 10. New Reflection Interfaces</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="reflection.html#reflection_api">Using AjTypeSystem</a></dt></dl></div><p>
AspectJ 5 provides a full set of reflection APIs analogous to the
<tt>java.lang.reflect</tt> 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.
</p><div class="sect1"><a name="reflection_api"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="reflection_api"></a>Using AjTypeSystem</h2></div></div><p>
The starting point for using the reflection apis is
<tt>org.aspectj.lang.reflect.AjTypeSystem</tt> which
provides the method <tt>getAjType(Class)</tt> which will
return the <tt>AjType</tt> corresponding to a given
Java class. The <tt>AjType</tt> interface corresponds to
<tt>java.lang.Class</tt> 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.
</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ataspectj-aspectof.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="miscellaneous.html">Next</a></td></tr><tr><td width="40%" align="left">aspectOf() and hasAspect() methods&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right">&nbsp;Chapter 11. Other Changes in AspectJ 5</td></tr></table></div></body></html>