Class ResolvedOperationInHierarchy
- java.lang.Object
-
- org.eclipse.xtext.xbase.typesystem.override.AbstractResolvedFeature<T>
-
- org.eclipse.xtext.xbase.typesystem.override.AbstractResolvedExecutable<org.eclipse.xtext.common.types.JvmOperation>
-
- org.eclipse.xtext.xbase.typesystem.override.AbstractResolvedOperation
-
- org.eclipse.xtext.xbase.typesystem.override.ResolvedOperationInHierarchy
-
- All Implemented Interfaces:
IResolvedExecutable,IResolvedFeature,IResolvedOperation
public class ResolvedOperationInHierarchy extends AbstractResolvedOperation
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedResolvedOperationInHierarchy(org.eclipse.xtext.common.types.JvmOperation declaration, BottomResolvedOperation bottom)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IResolvedOperationgetAsBottom()Returns the current method as abottom method.protected BottomResolvedOperationgetBottom()protected java.util.Map<org.eclipse.xtext.common.types.JvmTypeParameter,LightweightMergedBoundTypeArgument>getContextTypeParameterMapping()IOverrideCheckResultgetOverrideCheckResult()The override check result that is associated with this operation.java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter>getResolvedTypeParameters()Returns the resolved type parameters for a given operation.protected TypeParameterSubstitutor<?>getSubstitutor()booleanisBottomInContext()Returnstrueif the bottom of this resolved method hierachy, which that there is no specialization of this method in the current context.protected voidsetCheckResult(IOverrideCheckResult checkResult)java.lang.StringtoString()-
Methods inherited from class org.eclipse.xtext.xbase.typesystem.override.AbstractResolvedOperation
createResolvedOperationInHierarchy, getIllegallyDeclaredExceptions, getOverriddenAndImplementedMethodCandidates, getOverriddenAndImplementedMethods, getOverriddenMethod, getOverrideTester, getResolvedReturnType, getResolvedTypeParameterConstraints, isIllegallyDeclaredException, isOverridingOrImplementing, isRawTypeInheritance, isResolvedTypeParameter
-
Methods inherited from class org.eclipse.xtext.xbase.typesystem.override.AbstractResolvedExecutable
getResolvedErasureSignature, getResolvedExceptions, getResolvedParameterTypes, getResolvedSignature, getSimpleSignature, getTypeParameters
-
Methods inherited from class org.eclipse.xtext.xbase.typesystem.override.AbstractResolvedFeature
computeContextTypeParameterMapping, getContextType, getDeclaration, getResolvedDeclarator, getResolvedReference, getResolvedReferences, isResolvedTypeParameter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.xtext.xbase.typesystem.override.IResolvedExecutable
getResolvedExceptions, getResolvedParameterTypes, getTypeParameters
-
Methods inherited from interface org.eclipse.xtext.xbase.typesystem.override.IResolvedFeature
getContextType, getResolvedDeclarator, getResolvedErasureSignature, getResolvedSignature, getSimpleSignature
-
Methods inherited from interface org.eclipse.xtext.xbase.typesystem.override.IResolvedOperation
getDeclaration
-
-
-
-
Constructor Detail
-
ResolvedOperationInHierarchy
protected ResolvedOperationInHierarchy(org.eclipse.xtext.common.types.JvmOperation declaration, BottomResolvedOperation bottom)
-
-
Method Detail
-
getResolvedTypeParameters
public java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter> getResolvedTypeParameters()
Description copied from interface:IResolvedOperationReturns the resolved type parameters for a given operation. If this operation represents an overridden operation, the type parameters are the ones that are declared on the initially requested resolved operation. Consider the following interface and implementation class:interface I { <T extends CharSequence> T method() } class C implements I { public <V extends CharSequence> V method() { return null; } }If the initially requested method wasC#methodand the current handle points toI#method, the type parameters will containVinstead ofT. 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 methodI#methodin the context of classCwill yield an empty list of resolved type parameters even though itdeclaresT.- Specified by:
getResolvedTypeParametersin interfaceIResolvedOperation- Overrides:
getResolvedTypeParametersin classAbstractResolvedOperation- Returns:
- the list of resolved type parameters.
-
isBottomInContext
public boolean isBottomInContext()
Description copied from interface:IResolvedOperationReturnstrueif the bottom of this resolved method hierachy, which that there is no specialization of this method in the current context.interface I1 { void m() } interface I2 { void m() } abstract class C implements I1, I2 { }If you get hold on the abstract methodI1#morI2#mboth will returntrue.- See Also:
IResolvedOperation.getAsBottom()
-
getBottom
protected BottomResolvedOperation getBottom()
- Specified by:
getBottomin classAbstractResolvedOperation
-
getAsBottom
public IResolvedOperation getAsBottom()
Description copied from interface:IResolvedOperationReturns the current method as abottom method. That implies, that thecontext typeof the result is the resolved declarator of the currentdeclaration.interface I<T> { <K> T m(K k); } class C implements I<V< { <U> V m(U u); }If this resolved method representsI#min the context of classC(thus the return type will beVand theresolved type parametersincludeU,IResolvedOperation.getAsBottom()will yieldI#min the context ofI<V<. That is, the return type is still resolved toV. Nevertheless, the local type parameter ofI#mis now resolved to its declarationK. This implies that the parameter type is no longer resolved toUbutKinstead. The bottom representation can be used to create descriptive error messages. If the current resolved method is already a bottom type, it is returned itself.- Returns:
- the current operation as bottom type.
- See Also:
IResolvedOperation.isBottomInContext()
-
getSubstitutor
protected TypeParameterSubstitutor<?> getSubstitutor()
- Overrides:
getSubstitutorin classAbstractResolvedFeature<org.eclipse.xtext.common.types.JvmOperation>
-
getContextTypeParameterMapping
protected java.util.Map<org.eclipse.xtext.common.types.JvmTypeParameter,LightweightMergedBoundTypeArgument> getContextTypeParameterMapping()
- Overrides:
getContextTypeParameterMappingin classAbstractResolvedFeature<org.eclipse.xtext.common.types.JvmOperation>
-
getOverrideCheckResult
public IOverrideCheckResult getOverrideCheckResult()
Description copied from interface:IResolvedOperationThe override check result that is associated with this operation. If this is abottom, thedetailswill only include thecurrentdetail. In other cases, the actual information about the relationship of the hierarchy function to its specialization in thecontextis returned.- Returns:
- the computed check result
-
setCheckResult
protected void setCheckResult(IOverrideCheckResult checkResult)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAbstractResolvedExecutable<org.eclipse.xtext.common.types.JvmOperation>
-
-