Package org.aspectj.weaver.patterns
Klasse Pointcut
java.lang.Object
org.aspectj.weaver.patterns.PatternNode
org.aspectj.weaver.patterns.Pointcut
- Alle implementierten Schnittstellen:
IHasPosition
,IHasSourceLocation
- Bekannte direkte Unterklassen:
AndPointcut
,CflowPointcut
,ConcreteCflowPointcut
,HandlerPointcut
,IfPointcut
,KindedPointcut
,NameBindingPointcut
,NotPointcut
,OrPointcut
,PerClause
,PointcutDesignatorHandlerBasedPointcut
,ReferencePointcut
,WithincodePointcut
,WithinPointcut
The lifecycle of Pointcuts is modeled by Pointcut.State. It has three things:
Creation -- SYMBOLIC -- then resolve(IScope) -- RESOLVED -- concretize(...) -- CONCRETE
- Autor:
- Erik Hilsdale, Jim Hugunin A day in the life of a pointcut.... - AMC. ========================================== Pointcuts are created by the PatternParser, which is called by ajdt to parse a pointcut from the PseudoTokens AST node (which in turn are part of a PointcutDesignator AST node). Pointcuts are resolved by ajdt when an AdviceDeclaration or a PointcutDeclaration has its statements resolved. This happens as part of completeTypeBindings in the AjLookupEnvironment which is called after the diet parse phase of the compiler. Named pointcuts, and references to named pointcuts are instances of ReferencePointcut. At the end of the compilation process, the pointcuts are serialized (write method) into attributes in the class file. When the weaver loads the class files, it unpacks the attributes and deserializes the pointcuts (read). All aspects are added to the world, by calling addOrReplaceAspect on the crosscutting members set of the world. When aspects are added or replaced, the crosscutting members in the aspect are extracted as ShadowMungers (each holding a pointcut). The ShadowMungers are concretized, which concretizes the pointcuts. At this stage ReferencePointcuts are replaced by their declared content. During weaving, the weaver processes type by type. It first culls potentially matching ShadowMungers by calling the fastMatch method on their pointcuts. Only those that might match make it through to the next phase. At the next phase, all of the shadows within the type are created and passed to the pointcut for matching (match). When the actual munging happens, matched pointcuts are asked for their residue (findResidue) - the runtime test if any. Because of negation, findResidue may be called on pointcuts that could never match the shadow.
-
Verschachtelte Klassen - Übersicht
-
Feldübersicht
Modifizierer und TypFeldBeschreibungstatic final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final Pointcut.State
static final String[]
static final byte
protected boolean
static final byte
static final byte
static final byte
static final byte
protected int
String[]
ATAJ the name of the formal for which we don't want any warning when unbound since we consider them as implicitly bound. f.e.static final byte
static final byte
static final byte
protected byte
static final byte
static final Pointcut.State
static final Pointcut.State
static final byte
static final byte
static final byte
static final byte
Von Klasse geerbte Felder org.aspectj.weaver.patterns.PatternNode
end, sourceContext, start
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
assertState
(Pointcut.State state) void
check
(ISourceContext ctx, World world) final Pointcut
concretize
(ResolvedType inAspect, ResolvedType declaringType, int arity) Returns a new pointcut Only used by test casesfinal Pointcut
concretize
(ResolvedType inAspect, ResolvedType declaringType, int arity, ShadowMunger advice) final Pointcut
concretize
(ResolvedType inAspect, ResolvedType declaringType, IntMap bindings) protected abstract Pointcut
concretize1
(ResolvedType inAspect, ResolvedType declaringType, IntMap bindings) Resolves and removes ReferencePointcuts, replacing with basic onesabstract int
The set of ShadowKinds that this Pointcut could possibly match - an int whose bits are set according to the Kinds specified in Shadow.javaabstract FuzzyBoolean
fastMatch
(FastMatchInfo info) Could I match any shadows in the code defined within this type?final Test
findResidue
(Shadow shadow, ExposedState state) This can be called from NotPointcut even for Pointcuts that don't match the shadowprotected abstract Test
findResidueInternal
(Shadow shadow, ExposedState state) static Pointcut
fromString
(String str) byte
String[]
boolean
isDeclare
(ShadowMunger munger) static Pointcut
makeMatchesNothing
(Pointcut.State state) final FuzzyBoolean
Do I really match this shadow?protected abstract FuzzyBoolean
matchInternal
(Shadow shadow) abstract Pointcut
parameterizeWith
(Map<String, UnresolvedType> typeVariableMap, World w) void
postRead
(ResolvedType enclosingType) static Pointcut
read
(VersionedDataInputStream s, ISourceContext context) final Pointcut
Returns this pointcut mutatedprotected abstract void
resolveBindings
(IScope scope, Bindings bindings) void
setTypeVariablesInScope
(String[] typeVars) protected boolean
Von Klasse geerbte Methoden org.aspectj.weaver.patterns.PatternNode
accept, copyLocationFrom, getEnd, getFileName, getSourceContext, getSourceLocation, getStart, readLocation, setLocation, traverse, write, writeLocation
-
Felddetails
-
m_ignoreUnboundBindingForNames
ATAJ the name of the formal for which we don't want any warning when unbound since we consider them as implicitly bound. f.e. JoinPoint for @AJ advices -
EMPTY_STRING_ARRAY
-
SYMBOLIC
-
RESOLVED
-
CONCRETE
-
pointcutKind
protected byte pointcutKind -
state
-
lastMatchedShadowId
protected int lastMatchedShadowId -
hasBeenParameterized
protected boolean hasBeenParameterized -
KINDED
public static final byte KINDED- Siehe auch:
-
WITHIN
public static final byte WITHIN- Siehe auch:
-
THIS_OR_TARGET
public static final byte THIS_OR_TARGET- Siehe auch:
-
ARGS
public static final byte ARGS- Siehe auch:
-
AND
public static final byte AND- Siehe auch:
-
OR
public static final byte OR- Siehe auch:
-
NOT
public static final byte NOT- Siehe auch:
-
REFERENCE
public static final byte REFERENCE- Siehe auch:
-
IF
public static final byte IF- Siehe auch:
-
CFLOW
public static final byte CFLOW- Siehe auch:
-
WITHINCODE
public static final byte WITHINCODE- Siehe auch:
-
HANDLER
public static final byte HANDLER- Siehe auch:
-
IF_TRUE
public static final byte IF_TRUE- Siehe auch:
-
IF_FALSE
public static final byte IF_FALSE- Siehe auch:
-
ANNOTATION
public static final byte ANNOTATION- Siehe auch:
-
ATWITHIN
public static final byte ATWITHIN- Siehe auch:
-
ATWITHINCODE
public static final byte ATWITHINCODE- Siehe auch:
-
ATTHIS_OR_TARGET
public static final byte ATTHIS_OR_TARGET- Siehe auch:
-
NONE
public static final byte NONE- Siehe auch:
-
ATARGS
public static final byte ATARGS- Siehe auch:
-
USER_EXTENSION
public static final byte USER_EXTENSION- Siehe auch:
-
-
Konstruktordetails
-
Pointcut
public Pointcut()Constructor for Pattern.
-
-
Methodendetails
-
fastMatch
Could I match any shadows in the code defined within this type? -
couldMatchKinds
public abstract int couldMatchKinds()The set of ShadowKinds that this Pointcut could possibly match - an int whose bits are set according to the Kinds specified in Shadow.java -
getTypeVariablesInScope
-
setTypeVariablesInScope
-
match
Do I really match this shadow? XXX implementors need to handle state -
matchInternal
-
getPointcutKind
public byte getPointcutKind() -
resolveBindings
-
resolve
Returns this pointcut mutated -
concretize
Returns a new pointcut Only used by test cases -
concretize
public final Pointcut concretize(ResolvedType inAspect, ResolvedType declaringType, int arity, ShadowMunger advice) -
isDeclare
-
concretize
public final Pointcut concretize(ResolvedType inAspect, ResolvedType declaringType, IntMap bindings) -
shouldCopyLocationForConcretize
protected boolean shouldCopyLocationForConcretize() -
concretize1
protected abstract Pointcut concretize1(ResolvedType inAspect, ResolvedType declaringType, IntMap bindings) Resolves and removes ReferencePointcuts, replacing with basic ones- Parameter:
inAspect
- the aspect to resolve relative tobindings
- a Map from formal index in the current lexical context → formal index in the concrete advice that will run This must always return a new Pointcut object (even if the concretized Pointcut is identical to the resolved one). That behavior is assumed in many places. XXX fix implementors to handle state
-
findResidue
This can be called from NotPointcut even for Pointcuts that don't match the shadow -
findResidueInternal
-
postRead
-
read
- Löst aus:
IOException
-
check
-
fromString
-
makeMatchesNothing
-
assertState
-
parameterizeWith
-