Methods Summary |
---|
public com.sun.javadoc.MethodDoc[] | build()Return the array of interface methods which the method passed in the
constructor is implementing. The search/build order is as follows:
1. Search in all the immediate interfaces which this method's class is
implementing. Do it recursively for the superinterfaces as well.
2. Traverse all the superclasses and search recursively in the
interfaces which those superclasses implement.
ClassDoc icd = classdoc;
while (icd != null) {
buildImplementedMethodList(icd.interfaces());
icd = icd.superclass();
}
return (MethodDoc[])methlist.toArray(new MethodDoc[methlist.size()]);
|
private void | buildImplementedMethodList(com.sun.javadoc.ClassDoc[] intfacs)Search the method in the array of interfaces. If found check if it is
not overridden by any other subinterface method which this class
implements. If it is not overidden, add it in the method list.
Do it recursively for all the extended interfaces for each interface
from the array passed.
for (int i = 0; i < intfacs.length; i++) {
MethodDoc found = Util.findMethod(intfacs[i], method);
if (found != null) {
removeOverriddenMethod(found);
if (!overriddingMethodFound(found)) {
methlist.add(method);
}
}
ClassDoc[] iin = intfacs[i].interfaces();
buildImplementedMethodList(iin);
}
|
private boolean | overriddingMethodFound(com.sun.javadoc.MethodDoc method)Search in the already found methods' list if it contains a method which
is overridding the method as parameter or this method itself.
ClassDoc containingClass = method.containingClass();
for (int i = 0; i < methlist.size(); i++) {
ClassDoc cd = ((MethodDoc)methlist.get(i)).overriddenClass();
if (cd == containingClass || cd.subclassOf(containingClass)) {
return true;
}
}
return false;
|
private void | removeOverriddenMethod(com.sun.javadoc.MethodDoc method)Search in the already found methods' list if it contains a method which
is overridden by the method as parameter, remove the overridden method
from the method list.
ClassDoc overriddenClass = method.overriddenClass();
if (overriddenClass != null) {
for (int i = 0; i < methlist.size(); i++) {
ClassDoc cd = ((MethodDoc)methlist.get(i)).containingClass();
if (cd == overriddenClass || overriddenClass.subclassOf(cd)) {
methlist.remove(i); // remove overridden method
return;
}
}
}
|