Klasse Scope
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope
- Bekannte direkte Unterklassen:
BlockScope
,ClassScope
,CompilationUnitScope
-
Verschachtelte Klassen - Übersicht
-
Feldübersicht
Modifizierer und TypFeldBeschreibungstatic final int
static final int
static final int
static final int
static final int
static final int
int
static final int
static final int
static final int
static final int
static Binding
static final int
static final int
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungboxing
(TypeBinding type) checkRedundantDefaultNullness
(int nullBits, int sourceStart) Check whether the given null default is redundant at the given position inside this scope.final ClassScope
static int
compareTypes
(TypeBinding left, TypeBinding right) final CompilationUnitScope
final CompilerOptions
Finds the most specific compiler optionsprotected final MethodBinding
computeCompatibleMethod
(MethodBinding method, TypeBinding[] arguments, InvocationSite invocationSite) Internal use only Given a method, returns null if arguments cannot be converted to parameters.protected final MethodBinding
computeCompatibleMethod
(MethodBinding method, TypeBinding[] arguments, InvocationSite invocationSite, boolean tiebreakingVarargsMethods) Internal use only Given a method, returns null if arguments cannot be converted to parameters.protected boolean
connectTypeVariables
(TypeParameter[] typeParameters, boolean checkForErasedCandidateCollisions) Connect type variable supertypes, and returns true if no problem was detectedstatic TypeBinding
convertEliminatingTypeVariables
(TypeBinding originalType, ReferenceBinding genericType, int rank, Set eliminatedVariables) Returns a type where either all variables or specific ones got discarded.createArrayType
(TypeBinding type, int dimension) createArrayType
(TypeBinding type, int dimension, AnnotationBinding[] annotations) createTypeVariables
(TypeParameter[] typeParameters, Binding declaringElement) void
deferBoundCheck
(TypeReference typeRef) final ClassScope
final MethodScope
final MethodScope
final ReferenceBinding
Returns the immediately enclosing reference context, starting from current scope parent.final SourceTypeBinding
final ClassScope
final LookupEnvironment
protected MethodBinding
findDefaultAbstractMethod
(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite, ReferenceBinding classHierarchyStart, ObjectVector found, MethodBinding[] concreteMatches) findDirectMemberType
(char[] typeName, ReferenceBinding enclosingType) findExactMethod
(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) findField
(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite, boolean needResolve) findField
(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite, boolean needResolve, boolean invisibleFieldsOk) findMemberType
(char[] typeName, ReferenceBinding enclosingType) findMethod
(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite, boolean inStaticContext) findMethod0
(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite, boolean inStaticContext) findMethodForArray
(ArrayBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) protected void
findMethodInSuperInterfaces
(ReferenceBinding receiverType, char[] selector, ObjectVector found, List<TypeBinding> visitedTypes, InvocationSite invocationSite) static final IPrivilegedHandler
findType
(char[] typeName, PackageBinding declarationPackage, PackageBinding invocationPackage) findTypeVariable
(char[] name, SourceTypeBinding sourceType) Other scopes can override this methodfindVariable
(char[] variable, InvocationSite invocationSite) static TypeBinding
getBaseType
(char[] name) getBinding
(char[] name, int mask, InvocationSite invocationSite, boolean needResolve) getCommonReferenceBinding
(char[] typeName) getConstructor
(ReferenceBinding receiverType, TypeBinding[] argumentTypes, InvocationSite invocationSite) getConstructor0
(ReferenceBinding receiverType, TypeBinding[] argumentTypes, InvocationSite invocationSite) final PackageBinding
int
Returns the modifiers of the innermost enclosing declaration.getExactConstructor
(TypeBinding receiverType, InvocationSite invocationSite) getExactMethod
(TypeBinding receiverType, char[] selector, InvocationSite invocationSite) getField
(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite) getImplicitMethod
(char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
final ReferenceBinding
getMemberType
(char[] typeName, ReferenceBinding enclosingType) getMethod
(TypeBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) final Binding
getOnlyPackage
(char[][] compoundName) final Binding
getPackage
(char[][] compoundName) getStaticFactory
(ParameterizedTypeBinding allocationType, ReferenceBinding originalEnclosingType, TypeBinding[] argumentTypes, InvocationSite allocationSite) final TypeBinding
getType
(char[] name) final TypeBinding
getType
(char[][] compoundName, int typeNameLength) final TypeBinding
getType
(char[] name, PackageBinding packageBinding) final Binding
getTypeOrPackage
(char[][] compoundName) static ReferenceBinding[]
greaterLowerBound
(ReferenceBinding[] types) static TypeBinding[]
greaterLowerBound
(TypeBinding[] types, Scope scope, LookupEnvironment environment) boolean
hasDefaultNullnessFor
(int location, int sourceStart) Answer a defaultNullness defined for the closest enclosing scope, using bits from Binding.NullnessDefaultMASK.boolean
hasDefaultNullnessForType
(TypeBinding type, int location, int sourceStart) boolean
hasErasedCandidatesCollisions
(TypeBinding one, TypeBinding two, Map invocations, ReferenceBinding type, ASTNode typeRef) Returns the immediately enclosing switchCase statement (carried by closest blockScope),For Java scopes, the invocationType is always the same as the enclosingSourceType This distinction is important for AspectJ's inter-type declarations For inter-type declarations, the invocationType is the lexically enclosing type.protected boolean
isAcceptableMethod
(MethodBinding one, MethodBinding two) boolean
isBoxingCompatibleWith
(TypeBinding expressionType, TypeBinding targetType) final boolean
isDefinedInField
(FieldBinding field) final boolean
isDefinedInMethod
(MethodBinding method) final boolean
final boolean
boolean
isInsideCase
(CaseStatement caseStatement) Returns true if the scope or one of its parent is associated to a given caseStatement, denoting being part of a given switch case statement.boolean
boolean
boolean
boolean
boolean
isSubtypeOfRawType
(TypeBinding paramType) final MethodScope
protected final Binding
localCheckRedundantDefaultNullness
(int nullBits, int position) final int
localNonNullByDefaultValue
(int start) lowerUpperBound
(TypeBinding[] types) Returns VoidBinding if types have no intersection (e.g. 2 unrelated interfaces), or null if no common supertype (e.g.final MethodScope
protected TypeBinding[]
minimalErasedCandidates
(TypeBinding[] types, Map allInvocations) Returns the most specific set of types compatible with all given types.module()
protected final MethodBinding
mostSpecificClassMethodBinding
(MethodBinding[] visible, int visibleSize, InvocationSite invocationSite) protected final MethodBinding
mostSpecificInterfaceMethodBinding
(MethodBinding[] visible, int visibleSize, InvocationSite invocationSite) protected final MethodBinding
mostSpecificMethodBinding
(MethodBinding[] visible, int visibleSize, TypeBinding[] argumentTypes, InvocationSite invocationSite, ReferenceBinding receiverType) final MethodScope
Returns the nearest original reference context, starting from current scope.final ClassScope
final MethodScope
int
parameterCompatibilityLevel
(MethodBinding method, TypeBinding[] arguments) int
parameterCompatibilityLevel
(MethodBinding method, TypeBinding[] arguments, boolean tiebreakingVarargsMethods) int
parameterCompatibilityLevel
(MethodBinding method, TypeBinding[] arguments, InvocationSite site) int
parameterCompatibilityLevel
(TypeBinding arg, TypeBinding param) abstract ProblemReporter
See also the contract ofProblemReporter.close()
.boolean
recordNonNullByDefault
(Binding target, int value, Annotation annotation, int scopeStart, int scopeEnd) Record a NNBD annotation applying to a given source range within the current scopeReturns the nearest reference context, starting from current scope.void
static ReferenceBinding[]
substitute
(Substitution substitution, ReferenceBinding[] originalTypes) Returns an array of types, where original types got substituted given a substitution.static TypeBinding
substitute
(Substitution substitution, TypeBinding originalType) Returns a type, where original type was substituted using the receiver parameterized type.static TypeBinding[]
substitute
(Substitution substitution, TypeBinding[] originalTypes) Returns an array of types, where original types got substituted given a substitution.void
tagAsAccessingEnclosingInstanceStateOf
(ReferenceBinding enclosingType, boolean typeVariableAccess) static BlockScope
boolean
validateNullAnnotation
(long tagBits, TypeReference typeRef, Annotation[] annotations)
-
Felddetails
-
NOT_REDUNDANT
-
BLOCK_SCOPE
public static final int BLOCK_SCOPE- Siehe auch:
-
CLASS_SCOPE
public static final int CLASS_SCOPE- Siehe auch:
-
COMPILATION_UNIT_SCOPE
public static final int COMPILATION_UNIT_SCOPE- Siehe auch:
-
METHOD_SCOPE
public static final int METHOD_SCOPE- Siehe auch:
-
MODULE_SCOPE
public static final int MODULE_SCOPE- Siehe auch:
-
NOT_COMPATIBLE
public static final int NOT_COMPATIBLE- Siehe auch:
-
COMPATIBLE
public static final int COMPATIBLE- Siehe auch:
-
AUTOBOX_COMPATIBLE
public static final int AUTOBOX_COMPATIBLE- Siehe auch:
-
VARARGS_COMPATIBLE
public static final int VARARGS_COMPATIBLE- Siehe auch:
-
EQUAL_OR_MORE_SPECIFIC
public static final int EQUAL_OR_MORE_SPECIFIC- Siehe auch:
-
NOT_RELATED
public static final int NOT_RELATED- Siehe auch:
-
MORE_GENERIC
public static final int MORE_GENERIC- Siehe auch:
-
kind
public int kind -
parent
-
compilationUnitScope
-
-
Konstruktordetails
-
Scope
-
-
Methodendetails
-
setParent
-
compareTypes
-
convertEliminatingTypeVariables
public static TypeBinding convertEliminatingTypeVariables(TypeBinding originalType, ReferenceBinding genericType, int rank, Set eliminatedVariables) Returns a type where either all variables or specific ones got discarded. e.g. List(discarding Ungültige Eingabe: "<"E extends Enum ) will return: ListUngültige Eingabe: "<"? extends EnumUngültige Eingabe: "<"?>> -
getBaseType
-
greaterLowerBound
-
greaterLowerBound
public static TypeBinding[] greaterLowerBound(TypeBinding[] types, Scope scope, LookupEnvironment environment) -
substitute
public static ReferenceBinding[] substitute(Substitution substitution, ReferenceBinding[] originalTypes) Returns an array of types, where original types got substituted given a substitution. Only allocate an array if anything is different. -
substitute
Returns a type, where original type was substituted using the receiver parameterized type. In raw mode (seeSubstitution.isRawSubstitution()
), all parameterized types are converted to raw types. Cf. 4.8: "The type of a constructor (8.8), instance method (8.4, 9.4), or non-static field (8.3) M of a raw type C that is not inherited from its superclasses or superinterfaces is the raw type that corresponds to the erasure of its type in the generic declaration corresponding to C." -
substitute
Returns an array of types, where original types got substituted given a substitution. Only allocate an array if anything is different. -
boxing
-
classScope
-
compilationUnitScope
-
module
-
isLambdaScope
public boolean isLambdaScope() -
isLambdaSubscope
public boolean isLambdaSubscope() -
compilerOptions
Finds the most specific compiler options -
computeCompatibleMethod
protected final MethodBinding computeCompatibleMethod(MethodBinding method, TypeBinding[] arguments, InvocationSite invocationSite) Internal use only Given a method, returns null if arguments cannot be converted to parameters. Will answer a substituted method in case the method was generic and type inference got triggered; in case the method was originally compatible, then simply answer it back. -
computeCompatibleMethod
protected final MethodBinding computeCompatibleMethod(MethodBinding method, TypeBinding[] arguments, InvocationSite invocationSite, boolean tiebreakingVarargsMethods) Internal use only Given a method, returns null if arguments cannot be converted to parameters. Will answer a substituted method in case the method was generic and type inference got triggered; in case the method was originally compatible, then simply answer it back. -
connectTypeVariables
protected boolean connectTypeVariables(TypeParameter[] typeParameters, boolean checkForErasedCandidateCollisions) Connect type variable supertypes, and returns true if no problem was detected -
createArrayType
-
createArrayType
public ArrayBinding createArrayType(TypeBinding type, int dimension, AnnotationBinding[] annotations) -
createTypeVariables
public TypeVariableBinding[] createTypeVariables(TypeParameter[] typeParameters, Binding declaringElement) -
enclosingClassScope
-
enclosingTopMostClassScope
-
enclosingMethodScope
-
lexicallyEnclosingMethodScope
-
enclosingLambdaScope
-
enclosingReceiverType
-
enclosingReferenceContext
Returns the immediately enclosing reference context, starting from current scope parent. If starting on a class, it will skip current class. If starting on unitScope, returns null. -
enclosingSourceType
-
invocationType
For Java scopes, the invocationType is always the same as the enclosingSourceType This distinction is important for AspectJ's inter-type declarations For inter-type declarations, the invocationType is the lexically enclosing type. -
environment
-
findDefaultAbstractMethod
protected MethodBinding findDefaultAbstractMethod(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite, ReferenceBinding classHierarchyStart, ObjectVector found, MethodBinding[] concreteMatches) -
findDirectMemberType
-
findExactMethod
public MethodBinding findExactMethod(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) -
findPrivilegedHandler
-
findField
public FieldBinding findField(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite, boolean needResolve) -
findField
public FieldBinding findField(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite, boolean needResolve, boolean invisibleFieldsOk) -
findMemberType
-
findMethod
public MethodBinding findMethod(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite, boolean inStaticContext) -
findMethod0
public MethodBinding findMethod0(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite, boolean inStaticContext) -
findMethodForArray
public MethodBinding findMethodForArray(ArrayBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) -
findMethodInSuperInterfaces
protected void findMethodInSuperInterfaces(ReferenceBinding receiverType, char[] selector, ObjectVector found, List<TypeBinding> visitedTypes, InvocationSite invocationSite) -
findType
public ReferenceBinding findType(char[] typeName, PackageBinding declarationPackage, PackageBinding invocationPackage) -
findVariable
-
getBinding
public Binding getBinding(char[] name, int mask, InvocationSite invocationSite, boolean needResolve) -
getExactMethod
public MethodBinding getExactMethod(TypeBinding receiverType, char[] selector, InvocationSite invocationSite) -
getExactConstructor
-
getConstructor
public MethodBinding getConstructor(ReferenceBinding receiverType, TypeBinding[] argumentTypes, InvocationSite invocationSite) -
getConstructor0
public MethodBinding getConstructor0(ReferenceBinding receiverType, TypeBinding[] argumentTypes, InvocationSite invocationSite) -
getCurrentPackage
-
getDeclarationModifiers
public int getDeclarationModifiers()Returns the modifiers of the innermost enclosing declaration.- Gibt zurück:
- modifiers
-
getField
public FieldBinding getField(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite) -
getImplicitMethod
public MethodBinding getImplicitMethod(char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) -
getJavaIoSerializable
-
getJavaLangAnnotationAnnotation
-
getJavaLangAssertionError
-
getJavaLangBoolean
-
getJavaLangByte
-
getJavaLangCharacter
-
getJavaLangClass
-
getJavaLangCloneable
-
getJavaLangClassNotFoundException
-
getJavaLangDouble
-
getJavaLangFloat
-
getJavaLangIncompatibleClassChangeError
-
getJavaLangNoClassDefFoundError
-
getJavaLangNoSuchFieldError
-
getJavaLangEnum
-
getJavaLangError
-
getJavaLangReflectField
-
getJavaLangReflectMethod
-
getJavaLangRuntimeObjectMethods
-
getJavaLangRuntimeSwitchBootstraps
-
getJavaLangInvokeConstantBootstraps
-
getJavaLangEnumDesc
-
getJavaLangClassDesc
-
getJavaLangInvokeStringConcatFactory
-
getJavaLangRuntimeTemplateRuntimeBootstraps
-
getJavaLangInvokeLambdaMetafactory
-
getJavaLangInvokeSerializedLambda
-
getJavaLangInvokeMethodHandlesLookup
-
getJavaLangInvokeMethodHandle
-
getJavaLangInvokeVarHandle
-
getJavaLangInteger
-
getJavaLangIterable
-
getJavaLangLong
-
getJavaLangObject
-
getJavaLangRecord
-
getJavaLangShort
-
getJavaLangString
-
getJavaLangStringBuffer
-
getJavaLangStringBuilder
-
getJavaLangStringTemplateProcessor
-
getJavaLangThrowable
-
getJavaLangVoid
-
getJavaLangIllegalArgumentException
-
getJavaUtilIterator
-
getMemberType
-
getMethod
public MethodBinding getMethod(TypeBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) -
getPackage
-
getOnlyPackage
-
getType
-
getType
-
getType
-
getTypeOrPackage
-
hasErasedCandidatesCollisions
public boolean hasErasedCandidatesCollisions(TypeBinding one, TypeBinding two, Map invocations, ReferenceBinding type, ASTNode typeRef) -
innermostSwitchCase
Returns the immediately enclosing switchCase statement (carried by closest blockScope), -
isAcceptableMethod
-
isBoxingCompatibleWith
-
isDefinedInField
-
isDefinedInMethod
-
isDefinedInSameUnit
-
isDefinedInType
-
isInsideCase
Returns true if the scope or one of its parent is associated to a given caseStatement, denoting being part of a given switch case statement. -
isInsideDeprecatedCode
public boolean isInsideDeprecatedCode() -
isSubtypeOfRawType
-
lowerUpperBound
Returns VoidBinding if types have no intersection (e.g. 2 unrelated interfaces), or null if no common supertype (e.g. Listand List ), or the intersection type if possible -
methodScope
-
namedMethodScope
-
minimalErasedCandidates
Returns the most specific set of types compatible with all given types. (i.e. most specific common super types) If no types is given, will return an empty array. If not compatible reference type is found, returns null. In other cases, will return an array of minimal erased types, where some nulls may appear (and must simply be ignored). -
mostSpecificClassMethodBinding
protected final MethodBinding mostSpecificClassMethodBinding(MethodBinding[] visible, int visibleSize, InvocationSite invocationSite) -
mostSpecificInterfaceMethodBinding
protected final MethodBinding mostSpecificInterfaceMethodBinding(MethodBinding[] visible, int visibleSize, InvocationSite invocationSite) -
mostSpecificMethodBinding
protected final MethodBinding mostSpecificMethodBinding(MethodBinding[] visible, int visibleSize, TypeBinding[] argumentTypes, InvocationSite invocationSite, ReferenceBinding receiverType) -
outerMostClassScope
-
outerMostMethodScope
-
parameterCompatibilityLevel
public int parameterCompatibilityLevel(MethodBinding method, TypeBinding[] arguments, InvocationSite site) -
parameterCompatibilityLevel
-
parameterCompatibilityLevel
public int parameterCompatibilityLevel(MethodBinding method, TypeBinding[] arguments, boolean tiebreakingVarargsMethods) -
parameterCompatibilityLevel
-
problemReporter
See also the contract ofProblemReporter.close()
. -
referenceCompilationUnit
-
referenceContext
Returns the nearest reference context, starting from current scope. If starting on a class, it will return current class. If starting on unitScope, returns unit. -
originalReferenceContext
Returns the nearest original reference context, starting from current scope. If starting on a class, it will return current class. If starting on unitScope, returns unit. -
deferBoundCheck
-
getStaticFactory
public MethodBinding getStaticFactory(ParameterizedTypeBinding allocationType, ReferenceBinding originalEnclosingType, TypeBinding[] argumentTypes, InvocationSite allocationSite) -
validateNullAnnotation
public boolean validateNullAnnotation(long tagBits, TypeReference typeRef, Annotation[] annotations) -
recordNonNullByDefault
public boolean recordNonNullByDefault(Binding target, int value, Annotation annotation, int scopeStart, int scopeEnd) Record a NNBD annotation applying to a given source range within the current scope- Parameter:
target
- the annotated elementvalue
- bitset describing the default nullness (see Binding.NullnessDefaultMASK)annotation
- the NNBD annotationscopeStart
- start of the source range affected by the defaultscopeEnd
- end of the source range affected by the default- Gibt zurück:
true
if the annotation was newly recorded,false
if a corresponding entry already existed.
-
checkRedundantDefaultNullness
Check whether the given null default is redundant at the given position inside this scope.- Parameter:
nullBits
- locally defined nullness default, see Binding.NullnessDefaultMASK- Gibt zurück:
- enclosing binding that already has a matching NonNullByDefault annotation,
or the special binding
NOT_REDUNDANT
, indicating that a different enclosing nullness default was found, or null to indicate that no enclosing nullness default was found.
-
hasDefaultNullnessFor
public boolean hasDefaultNullnessFor(int location, int sourceStart) Answer a defaultNullness defined for the closest enclosing scope, using bits from Binding.NullnessDefaultMASK. -
hasDefaultNullnessForType
-
localNonNullByDefaultValue
public final int localNonNullByDefaultValue(int start) -
localCheckRedundantDefaultNullness
-
typeAnnotationsResolutionScope
-
tagAsAccessingEnclosingInstanceStateOf
public void tagAsAccessingEnclosingInstanceStateOf(ReferenceBinding enclosingType, boolean typeVariableAccess) -
getCommonReferenceBinding
-
findTypeVariable
Other scopes can override this method -
isInterTypeScope
public boolean isInterTypeScope()
-