public boolean subclassOf(ClassDoc arg0) { return wrapped.subclassOf(arg0); }
public final class ObjectListDoclet { public static final String TOP_CLASS_NAME = "com.example.MyClass"; /** Doclet entry point. */ public static boolean start(RootDoc root) throws Exception { try { ClassDoc topClassDoc = root.classNamed(TOP_CLASS_NAME); for (ClassDoc classDoc : root.classes()) { if (classDoc.subclassOf(topClassDoc)) { System.out.println(classDoc); } } return true; } catch (Exception ex) { ex.printStackTrace(); return false; } } }
/** * Search in the method list and check if it contains a method which * is overridden by the method as parameter. If found, remove the * overridden method from the method list. * * @param method Is this method overriding a method in the method list. */ private void removeOverriddenMethod(MethodDoc method) { ClassDoc overriddenClass = method.overriddenClass(); if (overriddenClass != null) { for (int i = 0; i < methlist.size(); i++) { ClassDoc cd = methlist.get(i).containingClass(); if (cd == overriddenClass || overriddenClass.subclassOf(cd)) { methlist.remove(i); // remove overridden method return; } } } }
/** * Search in the method list and check if it contains a method which * is overridden by the method as parameter. If found, remove the * overridden method from the method list. * * @param method Is this method overriding a method in the method list. */ private void removeOverriddenMethod(MethodDoc method) { ClassDoc overriddenClass = method.overriddenClass(); if (overriddenClass != null) { for (int i = 0; i < methlist.size(); i++) { ClassDoc cd = methlist.get(i).containingClass(); if (cd == overriddenClass || overriddenClass.subclassOf(cd)) { methlist.remove(i); // remove overridden method return; } } } }
/** * Search in the already found methods' list and check if it contains * a method which is overriding the method parameter or is the method * parameter itself. * * @param method MethodDoc Method to be searched in the Method List for * an overriding method. */ private boolean overridingMethodFound(MethodDoc method) { ClassDoc containingClass = method.containingClass(); for (int i = 0; i < methlist.size(); i++) { MethodDoc listmethod = methlist.get(i); if (containingClass == listmethod.containingClass()) { // it's the same method. return true; } ClassDoc cd = listmethod.overriddenClass(); if (cd == null) { continue; } if (cd == containingClass || cd.subclassOf(containingClass)) { return true; } } return false; } }
/** * Search in the already found methods' list and check if it contains * a method which is overriding the method parameter or is the method * parameter itself. * * @param method MethodDoc Method to be searched in the Method List for * an overriding method. */ private boolean overridingMethodFound(MethodDoc method) { ClassDoc containingClass = method.containingClass(); for (int i = 0; i < methlist.size(); i++) { MethodDoc listmethod = methlist.get(i); if (containingClass == listmethod.containingClass()) { // it's the same method. return true; } ClassDoc cd = listmethod.overriddenClass(); if (cd == null) { continue; } if (cd == containingClass || cd.subclassOf(containingClass)) { return true; } } return false; } }
for (ClassDoc classDoc : classes) { if ((classDoc.subclassOf(pluginClass) || (validatorClass != null && classDoc .subclassOf(validatorClass))) && classDoc.isOrdinaryClass()) { if (classDoc.subclassOf(pluginType)) {
if (classDoc.subclassOf(root.classNamed(Operator.class.getName()))) { try { System.out.println("Processing " + classDoc.typeName() + "...");
/** * {@inheritDoc} */ public void inherit(DocFinder.Input input, DocFinder.Output output) { ClassDoc exception; if (input.tagId == null) { ThrowsTag throwsTag = (ThrowsTag) input.tag; exception = throwsTag.exception(); input.tagId = exception == null ? throwsTag.exceptionName() : throwsTag.exception().qualifiedName(); } else { exception = input.element.containingClass().findClass(input.tagId); } ThrowsTag[] tags = ((MethodDoc)input.element).throwsTags(); for (int i = 0; i < tags.length; i++) { if (input.tagId.equals(tags[i].exceptionName()) || (tags[i].exception() != null && (input.tagId.equals(tags[i].exception().qualifiedName())))) { output.holder = input.element; output.holderTag = tags[i]; output.inlineTags = input.isFirstSentence ? tags[i].firstSentenceTags() : tags[i].inlineTags(); output.tagList.add(tags[i]); } else if (exception != null && tags[i].exception() != null && tags[i].exception().subclassOf(exception)) { output.tagList.add(tags[i]); } } }
/** * {@inheritDoc} */ public void inherit(DocFinder.Input input, DocFinder.Output output) { ClassDoc exception; if (input.tagId == null) { ThrowsTag throwsTag = (ThrowsTag) input.tag; exception = throwsTag.exception(); input.tagId = exception == null ? throwsTag.exceptionName() : throwsTag.exception().qualifiedName(); } else { exception = input.method.containingClass().findClass(input.tagId); } ThrowsTag[] tags = input.method.throwsTags(); for (int i = 0; i < tags.length; i++) { if (input.tagId.equals(tags[i].exceptionName()) || (tags[i].exception() != null && (input.tagId.equals(tags[i].exception().qualifiedName())))) { output.holder = input.method; output.holderTag = tags[i]; output.inlineTags = input.isFirstSentence ? tags[i].firstSentenceTags() : tags[i].inlineTags(); output.tagList.add(tags[i]); } else if (exception != null && tags[i].exception() != null && tags[i].exception().subclassOf(exception)) { output.tagList.add(tags[i]); } } }
(fd != null && fd.containingClass() .subclassOf(referencedMember.containingClass()))) { referencedMember = fd;