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 byte
protected AnnotationTypePattern
static final TypePattern
static final byte
static final byte
static final byte
static final TypePattern.MatchKind
static final TypePattern
static final byte
static final byte
static final byte
protected boolean
protected boolean
static final TypePattern
static final byte
static final byte
static final byte
static final TypePattern.MatchKind
static final byte
protected TypePatternList
static final byte
Fields inherited from class org.aspectj.weaver.patterns.PatternNode
end, sourceContext, start
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
TypePattern
(boolean includeSubtypes) protected
TypePattern
(boolean includeSubtypes, boolean isVarArgs) protected
TypePattern
(boolean includeSubtypes, boolean isVarArgs, TypePatternList typeParams) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
int
boolean
boolean
isArray()
boolean
For quickly recognizing the pattern '!void'boolean
boolean
boolean
isStar()
boolean
boolean
boolean
isVoid()
for quickly recognizing the pattern 'void'final FuzzyBoolean
matches
(ResolvedType type, TypePattern.MatchKind kind) protected abstract boolean
matchesArray
(UnresolvedType type) protected abstract boolean
matchesExactly
(ResolvedType type) protected abstract boolean
matchesExactly
(ResolvedType type, ResolvedType annotatedType) abstract FuzzyBoolean
boolean
protected boolean
matchesSubtypes
(ResolvedType type) protected boolean
matchesSubtypes
(ResolvedType superType, ResolvedType annotatedType) protected TypePattern
abstract TypePattern
parameterizeWith
(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.void
postRead
(ResolvedType enclosingType) static TypePattern
read
(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.void
resolveBindings
(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) void
void
setIsVarArgs
(boolean isVarArgs) void
setTypeParameters
(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() -
getDimensions
public int getDimensions() -
setAnnotationTypePattern
-
setTypeParameters
-
getTypeParameters
-
setIsVarArgs
public void setIsVarArgs(boolean isVarArgs) -
couldEverMatchSameTypesAs
-
matchesStatically
-
matchesInstanceof
-
matches
-
matchesExactly
-
matchesExactly
-
matchesArray
-
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()
-