Top Description Inners Fields Constructors Methods
org.aspectj.weaver.patterns

public abstract Class TypePattern

extends PatternNode
Class Inheritance
Known Direct Subclasses
org.aspectj.weaver.patterns.WildTypePattern, org.aspectj.weaver.patterns.AndTypePattern, org.aspectj.weaver.patterns.AnyTypePattern, org.aspectj.weaver.patterns.AnyWithAnnotationTypePattern, org.aspectj.weaver.patterns.ExactTypePattern, org.aspectj.weaver.patterns.HasMemberTypePattern, org.aspectj.weaver.patterns.EllipsisTypePattern, org.aspectj.weaver.patterns.NotTypePattern, org.aspectj.weaver.patterns.NoTypePattern, org.aspectj.weaver.patterns.OrTypePattern, org.aspectj.weaver.patterns.TypeCategoryTypePattern
Imports
java.io.IOException, java.util.Iterator, .Map, org.aspectj.bridge.MessageUtil, org.aspectj.util.FuzzyBoolean, org.aspectj.weaver.BCException, .ISourceContext, .IntMap, .ResolvedType, .TypeVariableReference, .UnresolvedType, .VersionedDataInputStream, .WeaverMessages, .World

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

Authors
Erik Hilsdale, Jim Hugunin

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final byte
protected AnnotationTypePattern
public static final TypePattern
public static final byte
public static final byte
public static final byte
public static final TypePattern.MatchKind
public static final TypePattern
public static final byte
public static final byte
public static final byte
protected boolean
protected boolean
public static final TypePattern
public static final byte
public static final byte
public static final byte
public static final TypePattern.MatchKind
public static final byte
protected TypePatternList
public static final byte
Inherited from org.aspectj.weaver.patterns.PatternNode:
endsourceContextstart

Constructor Summary

AccessConstructor and Description
protected
TypePattern(boolean includeSubtypes, boolean isVarArgs, TypePatternList typeParams)

protected
TypePattern(boolean includeSubtypes, boolean isVarArgs)

protected
TypePattern(boolean includeSubtypes)

Method Summary

Modifier and TypeMethod and Description
protected boolean
public AnnotationTypePattern
public int
public UnresolvedType
public TypePatternList
public boolean
public boolean
public boolean
isBangVoid()

For quickly recognizing the pattern '!void'

public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
isVoid()

for quickly recognizing the pattern 'void'

public final FuzzyBoolean
protected abstract boolean
protected abstract boolean
protected abstract boolean
public abstract FuzzyBoolean
public boolean
protected boolean
protected boolean
matchesSubtypes(ResolvedType superType, ResolvedType annotatedType)

protected TypePattern
public 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.

public void
postRead(ResolvedType enclosingType)

public static TypePattern
public 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 appropriate for the advice, rather than for the lexical declaration, i.e. this handles transformations through named pointcuts.

public void
resolve(World world)

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.

public UnresolvedType
resolveExactType(IScope scope, Bindings bindings)

public void
public void
setIsVarArgs(boolean isVarArgs)

public void
Inherited from org.aspectj.weaver.patterns.PatternNode:
acceptcopyLocationFromgetEndgetFileNamegetSourceContextgetSourceLocationgetStartreadLocationsetLocationtraversewritewriteLocation

Field Detail

ANDback to summary
public static final byte AND
annotationPatternback to summary
protected AnnotationTypePattern annotationPattern
ANYback to summary
public static final TypePattern ANY
ANY_KEYback to summary
public static final byte ANY_KEY
ANY_WITH_ANNOback to summary
public static final byte ANY_WITH_ANNO
BINDINGback to summary
public static final byte BINDING
DYNAMICback to summary
public static final TypePattern.MatchKind DYNAMIC
ELLIPSISback to summary
public static final TypePattern ELLIPSIS
ELLIPSIS_KEYback to summary
public static final byte ELLIPSIS_KEY
EXACTback to summary
public static final byte EXACT
HAS_MEMBERback to summary
public static final byte HAS_MEMBER
includeSubtypesback to summary
protected boolean includeSubtypes
isVarArgsback to summary
protected boolean isVarArgs
NOback to summary
public static final TypePattern NO
NO_KEYback to summary
public static final byte NO_KEY
NOTback to summary
public static final byte NOT
ORback to summary
public static final byte OR
STATICback to summary
public static final TypePattern.MatchKind STATIC
TYPE_CATEGORYback to summary
public static final byte TYPE_CATEGORY
typeParametersback to summary
protected TypePatternList typeParameters
WILDback to summary
public static final byte WILD

Constructor Detail

TypePatternback to summary
protected TypePattern(boolean includeSubtypes, boolean isVarArgs, TypePatternList typeParams)
TypePatternback to summary
protected TypePattern(boolean includeSubtypes, boolean isVarArgs)
TypePatternback to summary
protected TypePattern(boolean includeSubtypes)

Method Detail

couldEverMatchSameTypesAsback to summary
protected boolean couldEverMatchSameTypesAs(TypePattern other)
getAnnotationPatternback to summary
public AnnotationTypePattern getAnnotationPattern()
getDimensionsback to summary
public int getDimensions()
getExactTypeback to summary
public UnresolvedType getExactType()
getTypeParametersback to summary
public TypePatternList getTypeParameters()
hasFailedResolutionback to summary
public boolean hasFailedResolution()
isArrayback to summary
public boolean isArray()
isBangVoidback to summary
public boolean isBangVoid()

For quickly recognizing the pattern '!void'

isEllipsisback to summary
public boolean isEllipsis()
isIncludeSubtypesback to summary
public boolean isIncludeSubtypes()
isStarback to summary
public boolean isStar()
isStarAnnotationback to summary
public boolean isStarAnnotation()
isVarArgsback to summary
public boolean isVarArgs()
isVoidback to summary
public boolean isVoid()

for quickly recognizing the pattern 'void'

matchesback to summary
public final FuzzyBoolean matches(ResolvedType type, TypePattern.MatchKind kind)
matchesArrayback to summary
protected abstract boolean matchesArray(UnresolvedType type)
matchesExactlyback to summary
protected abstract boolean matchesExactly(ResolvedType type)
matchesExactlyback to summary
protected abstract boolean matchesExactly(ResolvedType type, ResolvedType annotatedType)
matchesInstanceofback to summary
public abstract FuzzyBoolean matchesInstanceof(ResolvedType type)
matchesStaticallyback to summary
public boolean matchesStatically(ResolvedType type)
matchesSubtypesback to summary
protected boolean matchesSubtypes(ResolvedType type)
matchesSubtypesback to summary
protected boolean matchesSubtypes(ResolvedType superType, ResolvedType annotatedType)
notExactTypeback to summary
protected TypePattern notExactType(IScope s)
parameterizeWithback to summary
public 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.

postReadback to summary
public void postRead(ResolvedType enclosingType)
readback to summary
public static TypePattern read(VersionedDataInputStream s, ISourceContext context) throws IOException
remapAdviceFormalsback to summary
public 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 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)
resolveback to summary
public void resolve(World world)
resolveBindingsback to summary
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.

resolveExactTypeback to summary
public UnresolvedType resolveExactType(IScope scope, Bindings bindings)
setAnnotationTypePatternback to summary
public void setAnnotationTypePattern(AnnotationTypePattern annPatt)
setIsVarArgsback to summary
public void setIsVarArgs(boolean isVarArgs)
setTypeParametersback to summary
public void setTypeParameters(TypePatternList typeParams)
org.aspectj.weaver.patterns back to summary

public Class TypePattern.MatchKind

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

nameback to summary
private String name

Constructor Detail

MatchKindback to summary
public MatchKind(String name)

Method Detail

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override