Package org.aspectj.weaver.patterns
Class TypePattern
java.lang.Object
org.aspectj.weaver.patterns.PatternNode
org.aspectj.weaver.patterns.TypePattern
- All Implemented Interfaces:
IHasPosition,IHasSourceLocation
- Direct Known Subclasses:
AndTypePattern,AnyTypePattern,AnyWithAnnotationTypePattern,EllipsisTypePattern,ExactTypePattern,HasMemberTypePattern,NotTypePattern,NoTypePattern,OrTypePattern,TypeCategoryTypePattern,WildTypePattern
On creation, type pattern only contains WildTypePattern nodes, not BindingType or ExactType.
Then we call resolveBindings() during compilation During concretization of enclosing pointcuts, we call remapAdviceFormals
- Author:
- Erik Hilsdale, Jim Hugunin
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteprotected AnnotationTypePatternstatic final TypePatternstatic final bytestatic final bytestatic final bytestatic final TypePattern.MatchKindstatic final TypePatternstatic final bytestatic final bytestatic final byteprotected booleanprotected booleanstatic final TypePatternstatic final bytestatic final bytestatic final bytestatic final TypePattern.MatchKindstatic final byteprotected TypePatternListstatic final byteFields inherited from class org.aspectj.weaver.patterns.PatternNode
end, sourceContext, start -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTypePattern(boolean includeSubtypes) protectedTypePattern(boolean includeSubtypes, boolean isVarArgs) protectedTypePattern(boolean includeSubtypes, boolean isVarArgs, TypePatternList typeParams) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanbooleanisArray()booleanFor quickly recognizing the pattern '!booleanbooleanbooleanisStar()booleanbooleanbooleanisVoid()for quickly recognizing the pattern 'void'final FuzzyBooleanmatches(ResolvedType type, TypePattern.MatchKind kind) protected abstract booleanmatchesExactly(ResolvedType type) protected abstract booleanmatchesExactly(ResolvedType type, ResolvedType annotatedType) abstract FuzzyBooleanbooleanprotected booleanmatchesSubtypes(ResolvedType type) protected booleanmatchesSubtypes(ResolvedType superType, ResolvedType annotatedType) protected TypePatternabstract TypePatternparameterizeWith(Map<String, UnresolvedType> typeVariableMap, World w) return a version of this type pattern in which all type variable references have been replaced by their corresponding entry in the map.voidpostRead(ResolvedType enclosingType) static TypePatternread(VersionedDataInputStream s, ISourceContext context) remapAdviceFormals(IntMap bindings) This is called during concretization of pointcuts, it is used by BindingTypePattern to return a new BindingTypePattern with a formal index appropriate for the advice, rather than for the lexical declaration, i.e. this handles transformations through named pointcuts.voidresolveBindings(IScope scope, Bindings bindings, boolean allowBinding, boolean requireExactType) This can modify in place, or return a new TypePattern if the type changes.resolveExactType(IScope scope, Bindings bindings) voidvoidsetIsVarArgs(boolean isVarArgs) voidsetTypeParameters(TypePatternList typeParams) Methods inherited from class org.aspectj.weaver.patterns.PatternNode
accept, copyLocationFrom, getEnd, getFileName, getSourceContext, getSourceLocation, getStart, readLocation, setLocation, traverse, write, writeLocation
-
Field Details
-
STATIC
-
DYNAMIC
-
ELLIPSIS
-
ANY
-
NO
-
includeSubtypes
protected boolean includeSubtypes -
isVarArgs
protected boolean isVarArgs -
annotationPattern
-
typeParameters
-
WILD
public static final byte WILD- See Also:
-
EXACT
public static final byte EXACT- See Also:
-
BINDING
public static final byte BINDING- See Also:
-
ELLIPSIS_KEY
public static final byte ELLIPSIS_KEY- See Also:
-
ANY_KEY
public static final byte ANY_KEY- See Also:
-
NOT
public static final byte NOT- See Also:
-
OR
public static final byte OR- See Also:
-
AND
public static final byte AND- See Also:
-
NO_KEY
public static final byte NO_KEY- See Also:
-
ANY_WITH_ANNO
public static final byte ANY_WITH_ANNO- See Also:
-
HAS_MEMBER
public static final byte HAS_MEMBER- See Also:
-
TYPE_CATEGORY
public static final byte TYPE_CATEGORY- See Also:
-
-
Constructor Details
-
TypePattern
-
TypePattern
protected TypePattern(boolean includeSubtypes, boolean isVarArgs) -
TypePattern
protected TypePattern(boolean includeSubtypes)
-
-
Method Details
-
getAnnotationPattern
-
isVarArgs
public boolean isVarArgs() -
isStarAnnotation
public boolean isStarAnnotation() -
isArray
public boolean isArray() -
setAnnotationTypePattern
-
setTypeParameters
-
getTypeParameters
-
setIsVarArgs
public void setIsVarArgs(boolean isVarArgs) -
couldEverMatchSameTypesAs
-
matchesStatically
-
matchesInstanceof
-
matches
-
matchesExactly
-
matchesExactly
-
matchesSubtypes
-
matchesSubtypes
-
resolveExactType
-
getExactType
-
notExactType
-
resolveBindings
public TypePattern resolveBindings(IScope scope, Bindings bindings, boolean allowBinding, boolean requireExactType) This can modify in place, or return a new TypePattern if the type changes. -
resolve
-
parameterizeWith
return a version of this type pattern in which all type variable references have been replaced by their corresponding entry in the map. -
postRead
-
isEllipsis
public boolean isEllipsis() -
isStar
public boolean isStar() -
remapAdviceFormals
This is called during concretization of pointcuts, it is used by BindingTypePattern to return a new BindingTypePattern with a formal index appropriate for the advice, rather than for the lexical declaration, i.e. this handles transformations through named pointcuts.pointcut foo(String name): args(name); --> This makes a BindingTypePattern(0) pointing to the 0th formal before(Foo f, String n): this(f) && foo(n) { ... } --> when resolveReferences is called on the args from the above, it will return a BindingTypePattern(1) before(Foo f): this(f) && foo(*) { ... } --> when resolveReferences is called on the args from the above, it will return an ExactTypePattern(String) -
read
public static TypePattern read(VersionedDataInputStream s, ISourceContext context) throws IOException - Throws:
IOException
-
isIncludeSubtypes
public boolean isIncludeSubtypes() -
isBangVoid
public boolean isBangVoid()For quickly recognizing the pattern '!void' -
isVoid
public boolean isVoid()for quickly recognizing the pattern 'void' -
hasFailedResolution
public boolean hasFailedResolution()
-