Package org.aspectj.weaver.patterns
Klasse WildTypePattern
java.lang.Object
org.aspectj.weaver.patterns.PatternNode
org.aspectj.weaver.patterns.TypePattern
org.aspectj.weaver.patterns.WildTypePattern
- Alle implementierten Schnittstellen:
IHasPosition,IHasSourceLocation
The PatternParser always creates WildTypePatterns for type patterns in pointcut expressions (apart from *, which is sometimes
directly turned into TypePattern.ANY). resolveBindings() tries to work out what we've really got and turn it into a type pattern
that we can use for matching. This will normally be either an ExactTypePattern or a WildTypePattern.
Here's how the process pans out for various generic and parameterized patterns: (see GenericsWildTypePatternResolvingTestCase)
Foo where Foo exists and is generic Parser creates WildTypePattern namePatterns={Foo} resolveBindings resolves Foo to RT(Foo -
raw) return ExactTypePattern(LFoo;)
Foo<String> where Foo exists and String meets the bounds Parser creates WildTypePattern namePatterns = {Foo},
typeParameters=WTP{String} resolveBindings resolves typeParameters to ExactTypePattern(String) resolves Foo to RT(Foo) returns
ExactTypePattern(PFoo<String>; - parameterized)
Foo<Str*> where Foo exists and takes one bound Parser creates WildTypePattern namePatterns = {Foo}, typeParameters=WTP{Str*}
resolveBindings resolves typeParameters to WTP{Str*} resolves Foo to RT(Foo) returns WildTypePattern(name = Foo, typeParameters =
WTP{Str*} isGeneric=false)
Fo*<String> Parser creates WildTypePattern namePatterns = {Fo*}, typeParameters=WTP{String} resolveBindings resolves
typeParameters to ETP{String} returns WildTypePattern(name = Fo*, typeParameters = ETP{String} isGeneric=false)
Foo<?>
Foo<? extends Number>
Foo<? extends Number+>
Foo<? super Number>
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen org.aspectj.weaver.patterns.TypePattern
TypePattern.MatchKind -
Feldübersicht
FelderVon 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, WILDVon Klasse geerbte Felder org.aspectj.weaver.patterns.PatternNode
end, sourceContext, start -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungWildTypePattern(List<NamePattern> names, boolean includeSubtypes, int dim) WildTypePattern(List<NamePattern> names, boolean includeSubtypes, int dim, int endPos) WildTypePattern(List<NamePattern> names, boolean includeSubtypes, int dim, int endPos, boolean isVarArg) WildTypePattern(List<NamePattern> names, boolean includeSubtypes, int dim, int endPos, boolean isVarArg, TypePatternList typeParams) WildTypePattern(List<NamePattern> names, boolean includeSubtypes, int dim, int endPos, boolean isVarArg, TypePatternList typeParams, TypePattern upperBound, TypePattern[] additionalInterfaceBounds, TypePattern lowerBound) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungaccept(PatternNodeVisitor visitor, Object data) protected booleanbooleanintUsed in conjunction with checks on 'isStar()' to tell you if this pattern represents '*' or '*[]' which are different !booleaninthashCode()booleanisArray()booleanisStar()protected booleanmatchesExactly(ResolvedType type) protected booleanmatchesExactly(ResolvedType type, ResolvedType annotatedType) booleanmaybeExtractName(String string) Method maybeExtractName.If this type pattern has no '*' or '..' in itIf this type pattern has no '.' or '*' in it, then return a simple string otherwise, this will return null;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.static TypePatternread(VersionedDataInputStream s, ISourceContext context) static TypePatternreadTypePattern150(VersionedDataInputStream s, ISourceContext context) static TypePatternresolveBindings(IScope scope, Bindings bindings, boolean allowBinding, boolean requireExactType) Need to determine if I'm really a pattern or a reference to a formal We may wish to further optimize the case of pattern vs. non-pattern We will be replaced by what we returnvoidsetIsVarArgs(boolean isVarArgs) static char[][]splitNames(String s, boolean convertDollar) toString()voidVon Klasse geerbte Methoden org.aspectj.weaver.patterns.TypePattern
getAnnotationPattern, getExactType, getTypeParameters, isBangVoid, isEllipsis, isIncludeSubtypes, isStarAnnotation, isVarArgs, isVoid, matches, matchesStatically, matchesSubtypes, matchesSubtypes, notExactType, postRead, remapAdviceFormals, resolve, resolveExactType, setAnnotationTypePattern, setTypeParametersVon Klasse geerbte Methoden org.aspectj.weaver.patterns.PatternNode
copyLocationFrom, getEnd, getFileName, getSourceContext, getSourceLocation, getStart, readLocation, setLocation, traverse, writeLocation
-
Felddetails
-
boundscheckingoff
public static boolean boundscheckingoff
-
-
Konstruktordetails
-
WildTypePattern
-
WildTypePattern
-
WildTypePattern
public WildTypePattern(List<NamePattern> names, boolean includeSubtypes, int dim, int endPos, boolean isVarArg) -
WildTypePattern
public WildTypePattern(List<NamePattern> names, boolean includeSubtypes, int dim, int endPos, boolean isVarArg, TypePatternList typeParams, TypePattern upperBound, TypePattern[] additionalInterfaceBounds, TypePattern lowerBound) -
WildTypePattern
public WildTypePattern(List<NamePattern> names, boolean includeSubtypes, int dim, int endPos, boolean isVarArg, TypePatternList typeParams)
-
-
Methodendetails
-
getNamePatterns
-
getUpperBound
-
getLowerBound
-
getAdditionalIntefaceBounds
-
setIsVarArgs
public void setIsVarArgs(boolean isVarArgs) - Setzt außer Kraft:
setIsVarArgsin KlasseTypePattern
-
couldEverMatchSameTypesAs
- Setzt außer Kraft:
couldEverMatchSameTypesAsin KlasseTypePattern
-
splitNames
-
matchesExactly
- Angegeben von:
matchesExactlyin KlasseTypePattern- Siehe auch:
-
matchesExactly
- Angegeben von:
matchesExactlyin KlasseTypePattern
-
getDimensions
public int getDimensions()Used in conjunction with checks on 'isStar()' to tell you if this pattern represents '*' or '*[]' which are different ! -
isArray
public boolean isArray()- Setzt außer Kraft:
isArrayin KlasseTypePattern
-
matchesInstanceof
- Angegeben von:
matchesInstanceofin KlasseTypePattern- Siehe auch:
-
extractName
-
maybeExtractName
Method maybeExtractName.- Parameter:
string-- Gibt zurück:
- boolean
-
maybeGetSimpleName
If this type pattern has no '.' or '*' in it, then return a simple string otherwise, this will return null; -
maybeGetCleanName
If this type pattern has no '*' or '..' in it -
parameterizeWith
Beschreibung aus Klasse kopiert:TypePatternreturn a version of this type pattern in which all type variable references have been replaced by their corresponding entry in the map.- Angegeben von:
parameterizeWithin KlasseTypePattern
-
resolveBindings
public TypePattern resolveBindings(IScope scope, Bindings bindings, boolean allowBinding, boolean requireExactType) Need to determine if I'm really a pattern or a reference to a formal We may wish to further optimize the case of pattern vs. non-pattern We will be replaced by what we return- Setzt außer Kraft:
resolveBindingsin KlasseTypePattern
-
isStar
public boolean isStar()- Setzt außer Kraft:
isStarin KlasseTypePattern
-
toString
-
equals
-
hashCode
public int hashCode() -
write
- Angegeben von:
writein KlassePatternNode- Löst aus:
IOException
-
read
public static TypePattern read(VersionedDataInputStream s, ISourceContext context) throws IOException - Löst aus:
IOException
-
readTypePattern150
public static TypePattern readTypePattern150(VersionedDataInputStream s, ISourceContext context) throws IOException - Löst aus:
IOException
-
readTypePatternOldStyle
public static TypePattern readTypePatternOldStyle(VersionedDataInputStream s, ISourceContext context) throws IOException - Löst aus:
IOException
-
accept
- Angegeben von:
acceptin KlassePatternNode
-
hasFailedResolution
public boolean hasFailedResolution()- Setzt außer Kraft:
hasFailedResolutionin KlasseTypePattern
-