Klasse HasMemberTypePatternForPerThisMatching
- Alle implementierten Schnittstellen:
IHasPosition
,IHasSourceLocation
aspect X perthis(transactional()) {
pointcut transactional: execution(@Foo * *(..));
When this occurs we obviously only want an aspect instance when there is a method annotated with @Foo. For a regular execution pointcut we couldn't really do this due to the multiple joinpoint signatures for each joinpoint (and so lots of types get the ajcMightHaveAspect interface). However, for an execution pointcut involving an annotation we can do something clever. Annotations must match against the first primary joinpoint signature - so when computing the type pattern to use for matching when processing the perthis() clause above, we can use the HasMemberTypePattern - because that effectively does what we want. We want an aspect instance if the type hasmethod(...) with the appropriate annotation. This would be great... but breaks in the face of ITDs. If the method that hasmethod() would match is introduced via an ITD we come unstuck, the code in HasMemberTypePattern.hasMethod() does look at ITDs but it won't see annotations, they aren't visible (at least through EclipseResolvedMember objects). And so this subclass is created to say 'if the supertype thinks it is a match, great, but if it doesnt then if there are ITDs on the target, they might match so just say 'true''. Note that returning true is just confirming whether the 'mightHaveAspect' interface (and friends) are getting added.
- Autor:
- Andy Clement
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen org.aspectj.weaver.patterns.TypePattern
TypePattern.MatchKind
-
Feldübersicht
Von Klasse geerbte Felder org.aspectj.weaver.patterns.TypePattern
AND, annotationPattern, ANY, ANY_KEY, ANY_WITH_ANNO, BINDING, DYNAMIC, ELLIPSIS, ELLIPSIS_KEY, EXACT, HAS_MEMBER, includeSubtypes, isVarArgs, NO, NO_KEY, NOT, OR, STATIC, TYPE_CATEGORY, typeParameters, WILD
Von Klasse geerbte Felder org.aspectj.weaver.patterns.PatternNode
end, sourceContext, start
-
Konstruktorübersicht
-
Methodenübersicht
Von Klasse geerbte Methoden org.aspectj.weaver.patterns.HasMemberTypePattern
accept, equals, getSignaturePattern, hashCode, matchesArray, matchesExactly, matchesExactly, matchesInstanceof, parameterizeWith, read, resolveBindings, toString, traverse
Von Klasse geerbte Methoden org.aspectj.weaver.patterns.TypePattern
couldEverMatchSameTypesAs, getAnnotationPattern, getDimensions, getExactType, getTypeParameters, hasFailedResolution, isArray, isBangVoid, isEllipsis, isIncludeSubtypes, isStar, isStarAnnotation, isVarArgs, isVoid, matches, matchesStatically, matchesSubtypes, matchesSubtypes, notExactType, postRead, remapAdviceFormals, resolve, resolveExactType, setAnnotationTypePattern, setIsVarArgs, setTypeParameters
Von Klasse geerbte Methoden org.aspectj.weaver.patterns.PatternNode
copyLocationFrom, getEnd, getFileName, getSourceContext, getSourceLocation, getStart, readLocation, setLocation, writeLocation
-
Konstruktordetails
-
HasMemberTypePatternForPerThisMatching
-
-
Methodendetails
-
hasMethod
- Setzt außer Kraft:
hasMethod
in KlasseHasMemberTypePattern
-
write
- Setzt außer Kraft:
write
in KlasseHasMemberTypePattern
- Löst aus:
IOException
-