Tests whether the specified method can be overridden/implemented by another method (of a descendant class).
The function uses the Doclet API method:
com.sun.javadoc.MethodDoc.overrides(MethodDoc)
and returns the result produced roughly by the call:
overridingMethod.overrides(method)
The need of such a function arises because of generic types introduced since Java 5. Before that, resolving whether a method overrides/implements another method could be done simply by comparing the parameter signatures of both methods as strings. But now, when a method has parameters whose types involve type variables, the situation cannot be resolved that simple.
Parameter:
method
TheMethodDoc
element representing the method to be overridden.If the passed element is not an instance of
MethodDoc
, the function will returnfalse
.If this parameter is not specified, the generator context element is assumed, i.e. the same as the call:
contextElement.isOverriddenBy(overridingMethod)
overridingMethod
TheMethodDoc
element representing the overriding method.If this is not an instance of
MethodDoc
, the function will returnfalse
.
Returns:
true
, if the methodmethod
can be overridden/implemented by the methodoverridingMethod
;false
, otherwise