org.aspectj.lang
Class Aspects14
java.lang.Object
org.aspectj.lang.Aspects14
public class Aspects14
extends java.lang.Object
For users working on a level of Java prior to Java5, Aspects14 handles generic aspectOf methods when they
are not available in the aspects but added later on through load time weaving. Users on Java5 should use
the class Aspects instead.
Aspects14.aspectOf(..) is doing reflective calls to the aspect aspectOf, so for better performance
consider using ajc compilation of the aspects and using them as a binary dependancies in your project.
static Object | aspectOf(Class aspectClass) - Returns the singleton aspect or the percflow / percflowbelow associated with the current thread
|
static Object | aspectOf(Class aspectClass, Class perTypeWithin) - Returns the pertypewithin aspect
|
static Object | aspectOf(Class aspectClass, Object perObject) - Returns the perthis / pertarget aspect
|
static boolean | hasAspect(Class aspectClass) - Returns true if singleton aspect or percflow / percflowbelow aspect is bound
|
static boolean | hasAspect(Class aspectClass, Class perTypeWithin) - Returns true if the pertypewithin aspect is bound
|
static boolean | hasAspect(Class aspectClass, Object perObject) - Returns true if the perthis / pertarget aspect is bound
|
aspectOf
public static Object aspectOf(Class aspectClass)
throws NoAspectBoundException
Returns the singleton aspect or the percflow / percflowbelow associated with the current thread
aspectOf
public static Object aspectOf(Class aspectClass,
Class perTypeWithin)
throws NoAspectBoundException
Returns the pertypewithin aspect
aspectClass
- perTypeWithin
- class
aspectOf
public static Object aspectOf(Class aspectClass,
Object perObject)
throws NoAspectBoundException
Returns the perthis / pertarget aspect
aspectClass
- perObject
-
hasAspect
public static boolean hasAspect(Class aspectClass)
throws NoAspectBoundException
Returns true if singleton aspect or percflow / percflowbelow aspect is bound
hasAspect
public static boolean hasAspect(Class aspectClass,
Class perTypeWithin)
throws NoAspectBoundException
Returns true if the pertypewithin aspect is bound
aspectClass
- perTypeWithin
- class
hasAspect
public static boolean hasAspect(Class aspectClass,
Object perObject)
throws NoAspectBoundException
Returns true if the perthis / pertarget aspect is bound
aspectClass
- perObject
-