public class OverrideHelper extends Object
| Constructor and Description |
|---|
OverrideHelper() |
| Modifier and Type | Method and Description |
|---|---|
protected TypeParameterSubstitutor<?> |
createSubstitutor(ITypeReferenceOwner owner,
LightweightTypeReference declaringType) |
JvmOperation |
findOverriddenOperation(JvmOperation operation) |
protected JvmOperation |
findOverriddenOperation(JvmOperation operation,
LightweightTypeReference declaringType,
TypeParameterSubstitutor<?> substitutor,
ITypeReferenceOwner owner,
IVisibilityHelper visibilityHelper) |
ResolvedFeatures |
getResolvedFeatures(JvmDeclaredType type)
Returns the resolved features that are defined in the given
type and its supertypes. |
ResolvedFeatures |
getResolvedFeatures(JvmDeclaredType type,
JavaVersion targetVersion)
Returns the resolved features targeting a specific Java version in order to support new language features.
|
ResolvedFeatures |
getResolvedFeatures(JvmTypeReference contextType)
Returns the resolved features that are defined in the given
context type and its supertypes. |
ResolvedFeatures |
getResolvedFeatures(JvmTypeReference contextType,
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,
JavaVersion targetVersion)
Returns the resolved features targeting a specific Java version in order to support new language features.
|
LightweightTypeReference |
getReturnTypeOfOverriddenOperation(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(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(JvmFormalParameter parameter,
JvmFormalParameter candidateParameter,
TypeParameterSubstitutor<?> substitutor,
ITypeReferenceOwner owner) |
public LightweightTypeReference getReturnTypeOfOverriddenOperation(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(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 JvmOperation findOverriddenOperation(JvmOperation operation, LightweightTypeReference declaringType, TypeParameterSubstitutor<?> substitutor, ITypeReferenceOwner owner, IVisibilityHelper visibilityHelper)
protected boolean isMatchesSignature(JvmFormalParameter parameter, JvmFormalParameter candidateParameter, TypeParameterSubstitutor<?> substitutor, ITypeReferenceOwner owner)
protected TypeParameterSubstitutor<?> createSubstitutor(ITypeReferenceOwner owner, LightweightTypeReference declaringType)
public JvmOperation findOverriddenOperation(JvmOperation operation)
public ResolvedFeatures getResolvedFeatures(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(JvmDeclaredType type, JavaVersion targetVersion)
public ResolvedFeatures getResolvedFeatures(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(JvmTypeReference contextType, JavaVersion targetVersion)
public ResolvedFeatures getResolvedFeatures(LightweightTypeReference contextType)
context type and its supertypes.
Considers private methods of super types, too.public ResolvedFeatures getResolvedFeatures(LightweightTypeReference contextType, JavaVersion targetVersion)
Copyright © 2015. All Rights Reserved.