@NonNullByDefault
public class OverrideHelper
extends java.lang.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,
OwnedConverter converter,
IVisibilityHelper visibilityHelper) |
java.util.List<JvmOperation> |
getAllOperations(JvmDeclaredType type,
ITypeReferenceOwner owner,
IVisibilityHelper visibilityHelper) |
java.util.List<JvmOperation> |
getAllOperations(LightweightTypeReference declaringType,
IVisibilityHelper visibilityHelper) |
ResolvedOperations |
getResolvedOperations(JvmDeclaredType type)
Returns the resolved operations that are defined in the given
type and its supertypes. |
ResolvedOperations |
getResolvedOperations(JvmTypeReference contextType)
Returns the resolved operations that are defined in the given
context type and its supertypes. |
ResolvedOperations |
getResolvedOperations(LightweightTypeReference contextType)
Returns the resolved operations that are defined in the given
context type and its supertypes. |
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. |
@Nullable 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 }
@Nullable 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 }
@Nullable protected JvmOperation findOverriddenOperation(JvmOperation operation, LightweightTypeReference declaringType, TypeParameterSubstitutor<?> substitutor, OwnedConverter converter, IVisibilityHelper visibilityHelper)
protected TypeParameterSubstitutor<?> createSubstitutor(ITypeReferenceOwner owner, LightweightTypeReference declaringType)
@Nullable public JvmOperation findOverriddenOperation(JvmOperation operation)
public ResolvedOperations getResolvedOperations(JvmDeclaredType type)
type
and its supertypes.
Considers private methods of super types, too.type
- the type. Has to be contained in a resource.public ResolvedOperations getResolvedOperations(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 ResolvedOperations getResolvedOperations(LightweightTypeReference contextType)
context type
and its supertypes.
Considers private methods of super types, too.public java.util.List<JvmOperation> getAllOperations(JvmDeclaredType type, ITypeReferenceOwner owner, IVisibilityHelper visibilityHelper)
public java.util.List<JvmOperation> getAllOperations(LightweightTypeReference declaringType, IVisibilityHelper visibilityHelper)