Package org.aspectj.lang
Klasse Aspects
java.lang.Object
org.aspectj.lang.Aspects
Handles generic aspectOf method when those are not available in the aspects but added later on
thru load time weaving.
Aspects.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.
- Autor:
- Alexandre Vasseur
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic <T> T
static <T> T
static <T> T
static boolean
static boolean
static boolean
-
Konstruktordetails
-
Aspects
public Aspects()
-
-
Methodendetails
-
aspectOf
- Typparameter:
T
- the expected class of the aspect- Parameter:
aspectClass
- the aspect class- Gibt zurück:
- the singleton aspect or the percflow / percflowbelow associated with the current thread
- Löst aus:
NoAspectBoundException
- if no such aspect
-
aspectOf
- Typparameter:
T
- the expected class of the aspect- Parameter:
aspectClass
- the aspect classperObject
- the this/target object for which to look for an aspect instance- Gibt zurück:
- the associated perthis / pertarget aspect instance
- Löst aus:
NoAspectBoundException
- if no such aspect, or no aspect bound
-
aspectOf
public static <T> T aspectOf(Class<T> aspectClass, Class<?> perTypeWithin) throws NoAspectBoundException - Typparameter:
T
- the expected class of the aspect- Parameter:
aspectClass
- the aspect classperTypeWithin
- the class for which to search for an aspect instance- Gibt zurück:
- the associated aspect instance
- Löst aus:
NoAspectBoundException
- if no such aspect, or no aspect bound
-
hasAspect
- Parameter:
aspectClass
- the aspect class- Gibt zurück:
- true if singleton aspect or percflow / percflowbelow aspect is bound
- Löst aus:
NoAspectBoundException
- if not bound
-
hasAspect
public static boolean hasAspect(Class<?> aspectClass, Object perObject) throws NoAspectBoundException - Parameter:
aspectClass
- the aspect classperObject
- the this/target object for which to look for an aspect instance- Gibt zurück:
- true if the perthis / pertarget aspect is bound
- Löst aus:
NoAspectBoundException
- if not bound
-
hasAspect
public static boolean hasAspect(Class<?> aspectClass, Class<?> perTypeWithin) throws NoAspectBoundException - Parameter:
aspectClass
- the aspect classperTypeWithin
- class- Gibt zurück:
- true if the pertypewithin aspect is bound
- Löst aus:
NoAspectBoundException
- if not bound
-