public class OverrideHelper
extends java.lang.Object
| Constructor and Description |
|---|
OverrideHelper() |
| Modifier and Type | Method and Description |
|---|---|
protected TypeParameterSubstitutor<?> |
createSubstitutor(ITypeReferenceOwner owner,
LightweightTypeReference declaringType) |
org.eclipse.xtext.common.types.JvmOperation |
findOverriddenOperation(org.eclipse.xtext.common.types.JvmOperation operation) |
protected org.eclipse.xtext.common.types.JvmOperation |
findOverriddenOperation(org.eclipse.xtext.common.types.JvmOperation operation,
LightweightTypeReference declaringType,
TypeParameterSubstitutor<?> substitutor,
ITypeReferenceOwner owner,
IVisibilityHelper visibilityHelper) |
ResolvedFeatures |
getResolvedFeatures(org.eclipse.xtext.common.types.JvmDeclaredType type)
Returns the resolved features that are defined in the given
type and its supertypes. |
ResolvedFeatures |
getResolvedFeatures(org.eclipse.xtext.common.types.JvmDeclaredType type,
org.eclipse.xtext.util.JavaVersion targetVersion)
Returns the resolved features targeting a specific Java version in order to support new language features.
|
ResolvedFeatures |
getResolvedFeatures(org.eclipse.xtext.common.types.JvmTypeReference contextType)
Returns the resolved features that are defined in the given
context type and its supertypes. |
ResolvedFeatures |
getResolvedFeatures(org.eclipse.xtext.common.types.JvmTypeReference contextType,
org.eclipse.xtext.util.JavaVersion targetVersion)
Returns the resolved features targeting a specific Java version in order to support new language features.
|
ResolvedFeatures |
getResolvedFeatures(LightweightTypeReference contextType)
Returns the resolved features that are defined in the given
context type and its supertypes. |
ResolvedFeatures |
getResolvedFeatures(LightweightTypeReference contextType,
org.eclipse.xtext.util.JavaVersion targetVersion)
Returns the resolved features targeting a specific Java version in order to support new language features.
|
LightweightTypeReference |
getReturnTypeOfOverriddenOperation(org.eclipse.xtext.common.types.JvmOperation operation,
ITypeReferenceOwner owner,
IVisibilityHelper visibilityHelper)
Returns
null if the given operation declares it's own return type or if it does not override
another operation. |
LightweightTypeReference |
getReturnTypeOfOverriddenOperation(org.eclipse.xtext.common.types.JvmOperation operation,
LightweightTypeReference context)
Returns
null if the given operation declares it's own return type or if it does not override
another operation. |
protected boolean |
isMatchesSignature(org.eclipse.xtext.common.types.JvmFormalParameter parameter,
org.eclipse.xtext.common.types.JvmFormalParameter candidateParameter,
TypeParameterSubstitutor<?> substitutor,
ITypeReferenceOwner owner) |
public LightweightTypeReference getReturnTypeOfOverriddenOperation(org.eclipse.xtext.common.types.JvmOperation operation, ITypeReferenceOwner owner, IVisibilityHelper visibilityHelper)
null if the given operation declares it's own return type or if it does not override
another operation.
TODO support this case:
interface I {
String m()
String m2()
}
class A {
CharSequence m()
int m2()
}
class B extends A implements I {
m() will expect String since this is the best choice
m2() will expect int since this is actually overridden and not compatible to String from I#m2
}
public LightweightTypeReference getReturnTypeOfOverriddenOperation(org.eclipse.xtext.common.types.JvmOperation operation, LightweightTypeReference context)
null if the given operation declares it's own return type or if it does not override
another operation.
TODO support this case:
interface I {
String m()
String m2()
}
class A {
CharSequence m()
int m2()
}
class B extends A implements I {
m() will expect String since this is the best choice
m2() will expect int since this is actually overridden and not compatible to String from I#m2
}
protected org.eclipse.xtext.common.types.JvmOperation findOverriddenOperation(org.eclipse.xtext.common.types.JvmOperation operation,
LightweightTypeReference declaringType,
TypeParameterSubstitutor<?> substitutor,
ITypeReferenceOwner owner,
IVisibilityHelper visibilityHelper)
protected boolean isMatchesSignature(org.eclipse.xtext.common.types.JvmFormalParameter parameter,
org.eclipse.xtext.common.types.JvmFormalParameter candidateParameter,
TypeParameterSubstitutor<?> substitutor,
ITypeReferenceOwner owner)
protected TypeParameterSubstitutor<?> createSubstitutor(ITypeReferenceOwner owner, LightweightTypeReference declaringType)
public org.eclipse.xtext.common.types.JvmOperation findOverriddenOperation(org.eclipse.xtext.common.types.JvmOperation operation)
public ResolvedFeatures getResolvedFeatures(org.eclipse.xtext.common.types.JvmDeclaredType type)
type and its supertypes.
Considers private methods of super types, too.type - the type. Has to be contained in a resource.public ResolvedFeatures getResolvedFeatures(org.eclipse.xtext.common.types.JvmDeclaredType type, org.eclipse.xtext.util.JavaVersion targetVersion)
public ResolvedFeatures getResolvedFeatures(org.eclipse.xtext.common.types.JvmTypeReference contextType)
context type and its supertypes.
Considers private methods of super types, too.contextType - the context type. Has to be contained in a resource.public ResolvedFeatures getResolvedFeatures(org.eclipse.xtext.common.types.JvmTypeReference contextType, org.eclipse.xtext.util.JavaVersion targetVersion)
public ResolvedFeatures getResolvedFeatures(LightweightTypeReference contextType)
context type and its supertypes.
Considers private methods of super types, too.public ResolvedFeatures getResolvedFeatures(LightweightTypeReference contextType, org.eclipse.xtext.util.JavaVersion targetVersion)