public abstract class TypePattern extends PatternNode
Then we call resolveBindings() during compilation During concretization of enclosing pointcuts, we call remapAdviceFormals
Modifier and Type | Class and Description |
---|---|
static class |
TypePattern.MatchKind |
Modifier and Type | Field and Description |
---|---|
static byte |
AND |
protected AnnotationTypePattern |
annotationPattern |
static TypePattern |
ANY |
static byte |
ANY_KEY |
static byte |
ANY_WITH_ANNO |
static byte |
BINDING |
static TypePattern.MatchKind |
DYNAMIC |
static TypePattern |
ELLIPSIS |
static byte |
ELLIPSIS_KEY |
static byte |
EXACT |
static byte |
HAS_MEMBER |
protected boolean |
includeSubtypes |
protected boolean |
isVarArgs |
static TypePattern |
NO |
static byte |
NO_KEY |
static byte |
NOT |
static byte |
OR |
static TypePattern.MatchKind |
STATIC |
static byte |
TYPE_CATEGORY |
protected TypePatternList |
typeParameters |
static byte |
WILD |
end, sourceContext, start
Modifier | Constructor and Description |
---|---|
protected |
TypePattern(boolean includeSubtypes) |
protected |
TypePattern(boolean includeSubtypes,
boolean isVarArgs) |
protected |
TypePattern(boolean includeSubtypes,
boolean isVarArgs,
TypePatternList typeParams) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
couldEverMatchSameTypesAs(TypePattern other) |
AnnotationTypePattern |
getAnnotationPattern() |
UnresolvedType |
getExactType() |
TypePatternList |
getTypeParameters() |
boolean |
hasFailedResolution() |
boolean |
isArray() |
boolean |
isBangVoid()
For quickly recognizing the pattern '!void'
|
boolean |
isEllipsis() |
boolean |
isIncludeSubtypes() |
boolean |
isStar() |
boolean |
isStarAnnotation() |
boolean |
isVarArgs() |
boolean |
isVoid()
for quickly recognizing the pattern 'void'
|
FuzzyBoolean |
matches(ResolvedType type,
TypePattern.MatchKind kind) |
protected abstract boolean |
matchesExactly(ResolvedType type) |
protected abstract boolean |
matchesExactly(ResolvedType type,
ResolvedType annotatedType) |
abstract FuzzyBoolean |
matchesInstanceof(ResolvedType type) |
boolean |
matchesStatically(ResolvedType type) |
protected boolean |
matchesSubtypes(ResolvedType type) |
protected boolean |
matchesSubtypes(ResolvedType superType,
ResolvedType annotatedType) |
protected TypePattern |
notExactType(IScope s) |
abstract TypePattern |
parameterizeWith(java.util.Map<java.lang.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) |
TypePattern |
remapAdviceFormals(IntMap bindings)
This is called during concretization of pointcuts, it is used by BindingTypePattern to return a new BindingTypePattern with a
formal index appropiate for the advice, rather than for the lexical declaration, i.e.
|
void |
resolve(World world) |
TypePattern |
resolveBindings(IScope scope,
Bindings bindings,
boolean allowBinding,
boolean requireExactType)
This can modify in place, or return a new TypePattern if the type changes.
|
UnresolvedType |
resolveExactType(IScope scope,
Bindings bindings) |
void |
setAnnotationTypePattern(AnnotationTypePattern annPatt) |
void |
setIsVarArgs(boolean isVarArgs) |
void |
setTypeParameters(TypePatternList typeParams) |
accept, copyLocationFrom, getEnd, getFileName, getSourceContext, getSourceLocation, getStart, readLocation, setLocation, traverse, write, writeLocation
public static final TypePattern.MatchKind STATIC
public static final TypePattern.MatchKind DYNAMIC
public static final TypePattern ELLIPSIS
public static final TypePattern ANY
public static final TypePattern NO
protected boolean includeSubtypes
protected boolean isVarArgs
protected AnnotationTypePattern annotationPattern
protected TypePatternList typeParameters
public static final byte WILD
public static final byte EXACT
public static final byte BINDING
public static final byte ELLIPSIS_KEY
public static final byte ANY_KEY
public static final byte NOT
public static final byte OR
public static final byte AND
public static final byte NO_KEY
public static final byte ANY_WITH_ANNO
public static final byte HAS_MEMBER
public static final byte TYPE_CATEGORY
protected TypePattern(boolean includeSubtypes, boolean isVarArgs, TypePatternList typeParams)
protected TypePattern(boolean includeSubtypes, boolean isVarArgs)
protected TypePattern(boolean includeSubtypes)
public AnnotationTypePattern getAnnotationPattern()
public boolean isVarArgs()
public boolean isStarAnnotation()
public boolean isArray()
public void setAnnotationTypePattern(AnnotationTypePattern annPatt)
public void setTypeParameters(TypePatternList typeParams)
public TypePatternList getTypeParameters()
public void setIsVarArgs(boolean isVarArgs)
protected boolean couldEverMatchSameTypesAs(TypePattern other)
public boolean matchesStatically(ResolvedType type)
public abstract FuzzyBoolean matchesInstanceof(ResolvedType type)
public final FuzzyBoolean matches(ResolvedType type, TypePattern.MatchKind kind)
protected abstract boolean matchesExactly(ResolvedType type)
protected abstract boolean matchesExactly(ResolvedType type, ResolvedType annotatedType)
protected boolean matchesSubtypes(ResolvedType type)
protected boolean matchesSubtypes(ResolvedType superType, ResolvedType annotatedType)
public UnresolvedType resolveExactType(IScope scope, Bindings bindings)
public UnresolvedType getExactType()
protected TypePattern notExactType(IScope s)
public TypePattern resolveBindings(IScope scope, Bindings bindings, boolean allowBinding, boolean requireExactType)
public void resolve(World world)
public abstract TypePattern parameterizeWith(java.util.Map<java.lang.String,UnresolvedType> typeVariableMap, World w)
public void postRead(ResolvedType enclosingType)
public boolean isEllipsis()
public boolean isStar()
public TypePattern remapAdviceFormals(IntMap bindings)
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)
public static TypePattern read(VersionedDataInputStream s, ISourceContext context) throws java.io.IOException
java.io.IOException
public boolean isIncludeSubtypes()
public boolean isBangVoid()
public boolean isVoid()
public boolean hasFailedResolution()