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
Von 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, WILD
Von Klasse geerbte Felder org.aspectj.weaver.patterns.PatternNode
end, sourceContext, start
-
Konstruktorübersicht
KonstruktorBeschreibungWildTypePattern
(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 boolean
boolean
int
Used in conjunction with checks on 'isStar()' to tell you if this pattern represents '*' or '*[]' which are different !boolean
int
hashCode()
boolean
isArray()
boolean
isStar()
protected boolean
matchesExactly
(ResolvedType type) protected boolean
matchesExactly
(ResolvedType type, ResolvedType annotatedType) boolean
maybeExtractName
(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 TypePattern
read
(VersionedDataInputStream s, ISourceContext context) static TypePattern
readTypePattern150
(VersionedDataInputStream s, ISourceContext context) static 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 returnvoid
setIsVarArgs
(boolean isVarArgs) static char[][]
splitNames
(String s, boolean convertDollar) toString()
void
Von 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, setTypeParameters
Von 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:
setIsVarArgs
in KlasseTypePattern
-
couldEverMatchSameTypesAs
- Setzt außer Kraft:
couldEverMatchSameTypesAs
in KlasseTypePattern
-
splitNames
-
matchesExactly
- Angegeben von:
matchesExactly
in KlasseTypePattern
- Siehe auch:
-
matchesExactly
- Angegeben von:
matchesExactly
in 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:
isArray
in KlasseTypePattern
-
matchesInstanceof
- Angegeben von:
matchesInstanceof
in 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:TypePattern
return a version of this type pattern in which all type variable references have been replaced by their corresponding entry in the map.- Angegeben von:
parameterizeWith
in 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:
resolveBindings
in KlasseTypePattern
-
isStar
public boolean isStar()- Setzt außer Kraft:
isStar
in KlasseTypePattern
-
toString
-
equals
-
hashCode
public int hashCode() -
write
- Angegeben von:
write
in 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:
accept
in KlassePatternNode
-
hasFailedResolution
public boolean hasFailedResolution()- Setzt außer Kraft:
hasFailedResolution
in KlasseTypePattern
-