public class CompoundReentrantTypeResolver extends java.util.AbstractList<IResolvedTypes> implements IReentrantTypeResolver, IResolvedTypes, java.util.RandomAccess
IResolvedTypes.NullResolvedTypes
NULL
NULL
Constructor and Description |
---|
CompoundReentrantTypeResolver(java.util.Set<org.eclipse.emf.ecore.EObject> allRootedExpressions) |
Modifier and Type | Method and Description |
---|---|
protected void |
addResolver(AbstractRootedReentrantTypeResolver resolver) |
IResolvedTypes |
get(int index) |
LightweightTypeReference |
getActualType(JvmIdentifiableElement identifiable)
Returns the actually inferred or declared type for the given identifiable or
null if none. |
LightweightTypeReference |
getActualType(XExpression expression)
Returns the actually inferred type for the given expression or
null if none. |
java.util.List<LightweightTypeReference> |
getActualTypeArguments(XExpression expression)
Returns the resolved type arguments.
|
java.util.Collection<IAmbiguousLinkingCandidate> |
getAmbiguousLinkingCandidates()
Returns all ambiguous linking candidates that have been encountered.
|
protected IResolvedTypes |
getDelegate(org.eclipse.emf.ecore.EObject object) |
protected IResolvedTypes |
getDelegate(int idx) |
protected IResolvedTypes |
getDelegate(XExpression expression) |
LightweightTypeReference |
getExpectedReturnType(XExpression expression)
Returns the expected return type for the given expression or
null if none. |
LightweightTypeReference |
getExpectedType(XExpression expression)
Returns the actually expected type for the given expression or
null if none. |
IExpressionScope |
getExpressionScope(org.eclipse.emf.ecore.EObject context,
IExpressionScope.Anchor anchor)
Returns the scope the given expression is contained in.
|
java.util.Collection<ILinkingCandidate> |
getFollowUpErrors()
Returns the linking candidates that could not be resolved but are not
exposed to the users because they are follow up errors.
|
JvmIdentifiableElement |
getLinkedFeature(XAbstractFeatureCall featureCall)
Returns the intermediate linking result for the given feature call, if any.
|
JvmIdentifiableElement |
getLinkedFeature(XConstructorCall constructorCall)
Returns the intermediate linking result for the given constructor call, if any.
|
IFeatureLinkingCandidate |
getLinkingCandidate(XAbstractFeatureCall featureCall)
Returns the intermediate linking candidate for the given feature call, if any.
|
IConstructorLinkingCandidate |
getLinkingCandidate(XConstructorCall constructorCall)
Returns the intermediate linking candidate for the given constructor call, if any.
|
protected CancelIndicator |
getMonitor() |
java.util.Collection<AbstractDiagnostic> |
getQueuedDiagnostics() |
LightweightTypeReference |
getReturnType(XExpression expression)
Returns the actually inferred return type for the given expression or
null if none. |
java.util.List<LightweightTypeReference> |
getThrownExceptions(XExpression obj) |
boolean |
hasExpressionScope(org.eclipse.emf.ecore.EObject context,
IExpressionScope.Anchor anchor) |
void |
initializeFrom(org.eclipse.emf.ecore.EObject root) |
boolean |
isRefinedType(XExpression expression)
Returns
true if the expression's type is based on a type
refinement, e.g. an instanceof guard my specialize the type of the checked
reference. |
boolean |
isVoidTypeAllowed(XExpression expression)
Returns
true if the given expression may have the type void . |
IResolvedTypes |
reentrantResolve(CancelIndicator monitor) |
int |
size() |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
public CompoundReentrantTypeResolver(java.util.Set<org.eclipse.emf.ecore.EObject> allRootedExpressions)
protected void addResolver(AbstractRootedReentrantTypeResolver resolver)
public void initializeFrom(org.eclipse.emf.ecore.EObject root)
initializeFrom
in interface IReentrantTypeResolver
public IResolvedTypes reentrantResolve(CancelIndicator monitor)
reentrantResolve
in interface IReentrantTypeResolver
protected CancelIndicator getMonitor()
protected IResolvedTypes getDelegate(int idx)
public java.util.Collection<AbstractDiagnostic> getQueuedDiagnostics()
getQueuedDiagnostics
in interface IResolvedTypes
public boolean isRefinedType(XExpression expression)
IResolvedTypes
true
if the expression's type is based on a type
refinement, e.g. an instanceof guard my specialize the type of the checked
reference. Any feature call to that reference is considered to be based on
a refined type.isRefinedType
in interface IResolvedTypes
expression
- the expression that may have been typed based on a refinement.true
if the type was refined, false
otherwise.public java.util.Collection<ILinkingCandidate> getFollowUpErrors()
IResolvedTypes
getFollowUpErrors
in interface IResolvedTypes
public java.util.Collection<IAmbiguousLinkingCandidate> getAmbiguousLinkingCandidates()
IResolvedTypes
getAmbiguousLinkingCandidates
in interface IResolvedTypes
public LightweightTypeReference getActualType(XExpression expression)
IResolvedTypes
null
if none.getActualType
in interface IResolvedTypes
expression
- expression whose type is queried.protected IResolvedTypes getDelegate(XExpression expression)
protected IResolvedTypes getDelegate(org.eclipse.emf.ecore.EObject object)
public IExpressionScope getExpressionScope(org.eclipse.emf.ecore.EObject context, IExpressionScope.Anchor anchor)
IResolvedTypes
getExpressionScope
in interface IResolvedTypes
public boolean hasExpressionScope(org.eclipse.emf.ecore.EObject context, IExpressionScope.Anchor anchor)
hasExpressionScope
in interface IResolvedTypes
public LightweightTypeReference getReturnType(XExpression expression)
IResolvedTypes
null
if none.getReturnType
in interface IResolvedTypes
expression
- expression whose return type is queried.public LightweightTypeReference getActualType(JvmIdentifiableElement identifiable)
IResolvedTypes
null
if none.getActualType
in interface IResolvedTypes
identifiable
- identifiable whose type is queried.public LightweightTypeReference getExpectedType(XExpression expression)
IResolvedTypes
null
if none.getExpectedType
in interface IResolvedTypes
expression
- expression whose expected type is queried.public java.util.List<LightweightTypeReference> getThrownExceptions(XExpression obj)
getThrownExceptions
in interface IResolvedTypes
public boolean isVoidTypeAllowed(XExpression expression)
IResolvedTypes
true
if the given expression may have the type void
.isVoidTypeAllowed
in interface IResolvedTypes
expression
- expression whose expected type is queried.public LightweightTypeReference getExpectedReturnType(XExpression expression)
IResolvedTypes
null
if none.getExpectedReturnType
in interface IResolvedTypes
expression
- expression whose expected return type is queried.public java.util.List<LightweightTypeReference> getActualTypeArguments(XExpression expression)
IResolvedTypes
class C<T, V> { public <PLgt; C(P p) {} }An invocation of the constructor
C
will return three type arguments, the bound
values of for P
, T
and V
.getActualTypeArguments
in interface IResolvedTypes
expression
- may either be an XAbstractFeatureCall
or XConstructorCall
. May not be null
.public JvmIdentifiableElement getLinkedFeature(XAbstractFeatureCall featureCall)
IResolvedTypes
null
, the result is null
.getLinkedFeature
in interface IResolvedTypes
featureCall
- the feature call that is queried for the current linking state.null
if none.public JvmIdentifiableElement getLinkedFeature(XConstructorCall constructorCall)
IResolvedTypes
null
, the result is null
.
If the constructor call is broken, it may return a JvmType
instead of
a JvmConstructor
.getLinkedFeature
in interface IResolvedTypes
constructorCall
- the constructor call that is queried for the current linking state.null
if none.public IFeatureLinkingCandidate getLinkingCandidate(XAbstractFeatureCall featureCall)
IResolvedTypes
null
, the result is null
.getLinkingCandidate
in interface IResolvedTypes
featureCall
- the feature call that is queried for the current linking state.null
if none.public IConstructorLinkingCandidate getLinkingCandidate(XConstructorCall constructorCall)
IResolvedTypes
null
, the result is null
.
If the constructor call is broken, it may return a JvmType
instead of
a JvmConstructor
.getLinkingCandidate
in interface IResolvedTypes
constructorCall
- the constructor call that is queried for the current linking state.null
if none.public IResolvedTypes get(int index)
get
in interface java.util.List<IResolvedTypes>
get
in class java.util.AbstractList<IResolvedTypes>
public int size()
size
in interface java.util.Collection<IResolvedTypes>
size
in interface java.util.List<IResolvedTypes>
size
in class java.util.AbstractCollection<IResolvedTypes>