public abstract class AbstractResolvedOperation extends AbstractResolvedExecutable<org.eclipse.xtext.common.types.JvmOperation> implements IResolvedOperation
JvmOperation.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractResolvedOperation(org.eclipse.xtext.common.types.JvmOperation declaration,
LightweightTypeReference contextType) |
| Modifier and Type | Method and Description |
|---|---|
protected ResolvedOperationInHierarchy |
createResolvedOperationInHierarchy(org.eclipse.xtext.common.types.JvmOperation candidate,
IOverrideCheckResult checkResult) |
protected abstract BottomResolvedOperation |
getBottom() |
java.util.List<LightweightTypeReference> |
getIllegallyDeclaredExceptions()
Returns the list of exceptions that are declared in this operation
but do not match the super implementation.
|
java.util.List<org.eclipse.xtext.common.types.JvmOperation> |
getOverriddenAndImplementedMethodCandidates()
Returns the inherited methods with the same simple name as this method.
|
java.util.List<IResolvedOperation> |
getOverriddenAndImplementedMethods()
Returns overridden and implemented methods for this method.
|
IResolvedOperation |
getOverriddenMethod()
Returns the overridden method, if any.
|
protected OverrideTester |
getOverrideTester() |
LightweightTypeReference |
getResolvedReturnType()
Returns the resolved return types in the current context.
|
java.util.List<LightweightTypeReference> |
getResolvedTypeParameterConstraints(int idx)
Returns the list of resolved constraints for the given type parameter index.
|
java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter> |
getResolvedTypeParameters()
Returns the resolved type parameters for a given operation.
|
protected boolean |
isIllegallyDeclaredException(LightweightTypeReference exception,
java.util.List<IResolvedOperation> overriddenAndImplemented) |
IOverrideCheckResult |
isOverridingOrImplementing(org.eclipse.xtext.common.types.JvmOperation operation)
Transitively check whether this operation if implementing or overriding the given operation.
|
protected boolean |
isRawTypeInheritance() |
protected boolean |
isResolvedTypeParameter(org.eclipse.xtext.common.types.JvmTypeParameter typeParameter)
Allows to refuse a certain type parameter to be substituted.
|
getResolvedErasureSignature, getResolvedExceptions, getResolvedParameterTypes, getResolvedSignature, getSimpleSignature, getTypeParameters, toStringcomputeContextTypeParameterMapping, getContextType, getContextTypeParameterMapping, getDeclaration, getResolvedDeclarator, getResolvedReference, getResolvedReferences, getSubstitutor, isResolvedTypeParameterclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAsBottom, getDeclaration, getOverrideCheckResult, isBottomInContextgetResolvedExceptions, getResolvedParameterTypes, getTypeParametersgetContextType, getResolvedDeclarator, getResolvedErasureSignature, getResolvedSignature, getSimpleSignatureprotected AbstractResolvedOperation(org.eclipse.xtext.common.types.JvmOperation declaration,
LightweightTypeReference contextType)
public java.util.List<IResolvedOperation> getOverriddenAndImplementedMethods()
IResolvedOperation
interface I {
void method()
}
abstract class C {
abstract void method()
}
class D extends C implements I {
void method() {}
}
The resolved representation of D#method will return a list with two elements:
C#method, I#method. The first element in the list is always the overridden implementation or the
inherited abstract method from the superclass, if any. Thus the list is sorted. The elements in the list are not
transitively collected.
interface I1 {
void method()
}
interface I2 {
void method()
}
interface I3 extends I1, I2 {
}
interface I4 {
void method()
}
interface I5 extends I4 {
void method()
}
class C implements I5, I3 {
void method()
}
The list of resolved inherited methods for C#method will be
I1#method, I2#method, I5#method thus it will not contain and of I4#method.
Only methods that would be successfully checked for IResolvedOperation.isOverridingOrImplementing(JvmOperation) will be
returned.getOverriddenAndImplementedMethods in interface IResolvedOperationIResolvedOperation.getOverriddenAndImplementedMethodCandidates()public IResolvedOperation getOverriddenMethod()
IResolvedOperationoverridden and implemented methods, and
the candidate is not abstract.
It may happen that two methods are overridden, e.g.
class A<T> {
void m(T t) {
}
void m(String s) {
}
}
class B extends A<String> {
@Override
void m(String s) {
}
}
In that case, the first match is returned thus it depends on the order in the super type.getOverriddenMethod in interface IResolvedOperationnull if none.IResolvedOperation.getOverriddenAndImplementedMethods()public java.util.List<LightweightTypeReference> getIllegallyDeclaredExceptions()
IResolvedOperationgetIllegallyDeclaredExceptions in interface IResolvedOperationprotected boolean isIllegallyDeclaredException(LightweightTypeReference exception, java.util.List<IResolvedOperation> overriddenAndImplemented)
protected ResolvedOperationInHierarchy createResolvedOperationInHierarchy(org.eclipse.xtext.common.types.JvmOperation candidate, IOverrideCheckResult checkResult)
public java.util.List<org.eclipse.xtext.common.types.JvmOperation> getOverriddenAndImplementedMethodCandidates()
IResolvedOperationgetOverriddenAndImplementedMethodCandidates in interface IResolvedOperationIResolvedOperation.getOverriddenAndImplementedMethods(),
IResolvedOperation.isOverridingOrImplementing(JvmOperation)public IOverrideCheckResult isOverridingOrImplementing(org.eclipse.xtext.common.types.JvmOperation operation)
IResolvedOperationisOverridingOrImplementing in interface IResolvedOperationpublic java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter> getResolvedTypeParameters()
IResolvedOperation
interface I {
<T extends CharSequence> T method()
}
class C implements I {
public <V extends CharSequence> V method() {
return null;
}
}
If the initially requested method was C#method and the current handle points to
I#method, the type parameters will contain V instead of T.
The list may contain a different number of type parameters than the actual operation.
interface I {
<T> T method()
}
class C implements I {
public String method() {
return null;
}
}
The method I#method in the context of class C will yield an empty list of resolved type
parameters even though it declares T.getResolvedTypeParameters in interface IResolvedOperationpublic java.util.List<LightweightTypeReference> getResolvedTypeParameterConstraints(int idx) throws java.lang.IndexOutOfBoundsException
IResolvedOperation
interface I<T> {
<V extends T> V method(Class<? extends V> c);
}
abstract class C implements I<CharSequence> {
}
The resolved constraint of I#method<V> in the context of class C is
CharSequence.getResolvedTypeParameterConstraints in interface IResolvedOperationidx - the index of the considered type parameter.idx.java.lang.IndexOutOfBoundsException - if the idx does not match the resolved type parameter list.IResolvedOperation.getResolvedTypeParameterConstraints(int)public LightweightTypeReference getResolvedReturnType()
IResolvedOperationgetResolvedReturnType in interface IResolvedOperationIResolvedFeature.getContextType(),
IResolvedOperation.getResolvedTypeParameters()protected boolean isRawTypeInheritance()
isRawTypeInheritance in class AbstractResolvedFeature<org.eclipse.xtext.common.types.JvmOperation>protected boolean isResolvedTypeParameter(org.eclipse.xtext.common.types.JvmTypeParameter typeParameter)
AbstractResolvedFeatureisResolvedTypeParameter in class AbstractResolvedFeature<org.eclipse.xtext.common.types.JvmOperation>typeParameter - the type parameter that should be substituted.false if the parameter may be substituted. true if it should be preserved.protected abstract BottomResolvedOperation getBottom()
protected OverrideTester getOverrideTester()