Top Description Fields Constructors Methods
org.aspectj.lang.reflect

public Class AjTypeSystem

extends Object
Class Inheritance
Imports
java.lang.ref.WeakReference, java.util.Collections, .Map, .WeakHashMap, org.aspectj.internal.lang.reflect.AjTypeImpl

This is the anchor for the AspectJ runtime type system. Typical usage to get the AjType representation of a given type at runtime is to call AjType<Foo> fooType = AjTypeSystem.getAjType(Foo.class);

Field Summary

Modifier and TypeField and Description
private static Map<Class<T>, WeakReference<AjType<T>>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static <
the expected type associated with the returned AjType
T
>
AjType<T>

Returns:

the AjType corresponding to the input class
getAjType
(Class<T>
the class for which to discover the AjType
fromClass
)

Return the AspectJ runtime type representation of the given Java type.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ajTypesback to summary
private static Map<Class<T>, WeakReference<AjType<T>>> ajTypes

Constructor Detail

AjTypeSystemback to summary
public AjTypeSystem()

Method Detail

getAjTypeback to summary
public static <T> AjType<T> getAjType(Class<T> fromClass)

Return the AspectJ runtime type representation of the given Java type. Unlike java.lang.Class, AjType understands pointcuts, advice, declare statements, and other AspectJ type members. AjType is the recommended reflection API for AspectJ programs as it offers everything that java.lang.reflect does, with AspectJ-awareness on top.

Parameters
<T>
the expected type associated with the returned AjType
fromClass:Class<T>

the class for which to discover the AjType

Returns:AjType<T>

the AjType corresponding to the input class