@Override public int compare(Object o1, Object o2) { ClassDoc c1 = (ClassDoc) o1; ClassDoc c2 = (ClassDoc) o2; return c1.qualifiedName().compareTo(c2.qualifiedName()); } });
final Object object; try { final Field declaredField = Class.forName(containingClass.qualifiedName(), false, Thread.currentThread() .getContextClassLoader()).getDeclaredField(referencedMember.name()); if (referencedMember.isFinal()) {
/** * Returns whether or not a class is a unit test. That is, whether or not it is a subclass of * {@link junit.framework.TestCase}. */ private static boolean isUnitTest(ClassDoc c) { if (c == null) { return false; } else if (c.qualifiedName().equals(TestCase.class.getName())) { return true; } else { return isUnitTest(c.superclass()); } }
/** * Summarizes the test methods of the given class */ public static void document(ClassDoc c, PrintWriter pw) throws IOException { pw.println(c.qualifiedName()); { String comment = c.commentText(); if (comment != null && !comment.equals("")) { pw.println(""); indent(comment, 4, pw); pw.println(""); } } MethodDoc[] methods = getTestMethods(c); for (int i = 0; i < methods.length; i++) { MethodDoc method = methods[i]; pw.print(" "); pw.println(method.name()); String comment = method.commentText(); if (comment != null && !comment.equals("")) { pw.println(""); indent(comment, 6, pw); pw.println(""); } } pw.println(""); }
public class ExtractCommentsDoclet { public static boolean start(RootDoc root) throws IOException { for (ClassDoc c : root.classes()) { print(c.qualifiedName(), c.commentText()); for (FieldDoc f : c.fields(false)) { print(f.qualifiedName(), f.commentText()); } for (MethodDoc m : c.methods(false)) { print(m.qualifiedName(), m.commentText()); if (m.commentText() != null && m.commentText().length() > 0) { for (ParamTag p : m.paramTags()) print(m.qualifiedName() + "@" + p.parameterName(), p.parameterComment()); for (Tag t : m.tags("return")) { if (t.text() != null && t.text().length() > 0) print(m.qualifiedName() + "@return", t.text()); } } } } return true; } private static void print(String name, String comment) throws IOException { if (comment != null && comment.length() > 0) { new FileWriter(name + ".txt").append(comment).close(); } } }
public int compare(Object o1, Object o2) { ClassDoc c1 = (ClassDoc) o1; ClassDoc c2 = (ClassDoc) o2; return c1.qualifiedName().compareTo(c2.qualifiedName()); } });
private <T> List<T> refList(Map<String,List<T>> map, ClassDoc cd) { List<T> list = map.get(cd.qualifiedName()); if (list == null) { List<T> l = new ArrayList<T>(); list = l; map.put(cd.qualifiedName(), list); } return list; }
private Set<PackageDoc> packageSet(ClassDoc cd) { Set<PackageDoc> pkgSet = classToPackage.get(cd.qualifiedName()); if (pkgSet == null) { pkgSet = new TreeSet<PackageDoc>(); classToPackage.put(cd.qualifiedName(), pkgSet); } return pkgSet; }
private Set<PackageDoc> packageSet(ClassDoc cd) { Set<PackageDoc> pkgSet = classToPackage.get(cd.qualifiedName()); if (pkgSet == null) { pkgSet = new TreeSet<PackageDoc>(); classToPackage.put(cd.qualifiedName(), pkgSet); } return pkgSet; }
public boolean matches(String name) { for (ClassDoc cd : packageDoc.allClasses()) { if (cd.qualifiedName().equals(name)) return true; } return false; }
/** * Get the current class for a meta tag keyword, as the first * and only element of an array list. */ protected ArrayList<String> getClassKeyword(ClassDoc classdoc) { String cltypelower = classdoc.isInterface() ? "interface" : "class"; ArrayList<String> metakeywords = new ArrayList<String>(1); metakeywords.add(classdoc.qualifiedName() + " " + cltypelower); return metakeywords; }
public boolean matches(String name) { for (ClassDoc cd : packageDoc.allClasses()) if (cd.qualifiedName().equals(name)) return true; return false; }
public ClassDocResource(OrchidContext context, ClassDoc classDoc) { super(new OrchidReference(context, classDoc.qualifiedName().replaceAll("\\.", "/") + ".html")); this.classDoc = classDoc; reference.setExtension("md"); }
public OrchidPage getClassPage(String className) { JavadocModel javadocModel = context.getInjector().getInstance(JavadocModel.class); for(JavadocClassPage classPage : javadocModel.getAllClasses()) { if(classPage.classDoc.qualifiedName().equals(className)) { return classPage; } else if(classPage.classDoc.name().equals(className)) { return classPage; } } return null; } }
public void overrideForClass(Options opt, ClassDoc cd) { opt.setOptions(cd); if (opt.matchesHideExpression(cd.qualifiedName()) || !(matcher.matches(cd) || opt.matchesIncludeExpression(cd.qualifiedName()))) opt.setOption(HIDE_OPTIONS); if (cd.equals(this.cd)) opt.nodeFillColor = "lemonChiffon"; }
public void overrideForClass(Options opt, ClassDoc cd) { opt.setOptions(cd); boolean inPackage = matcher.matches(cd); if (inPackage) opt.showQualified = false; boolean included = inPackage || this.opt.matchesIncludeExpression(cd.qualifiedName()); if (!included || this.opt.matchesHideExpression(cd.qualifiedName())) opt.setOption(HIDE); }
public String italicsClassName( ClassDoc cd, boolean qual ) { String name = (qual) ? cd.qualifiedName() : cd.name(); return (cd.isInterface()) ? italicsText( name ) : name; }
/** Convert the class name into a corresponding URL */ public String classToUrl(ClassDoc cd, boolean rootClass) { // building relative path for context and package diagrams if(contextPackageName != null && rootClass) return buildRelativePathFromClassNames(contextPackageName, cd.containingPackage().name()) + cd.name() + ".html"; return classToUrl(cd.qualifiedName()); }
private void writeConstantMember(FieldDoc member) { trBgcolorStyle("white", "TableRowColor"); anchor(currentClassDoc.qualifiedName() + "." + member.name()); writeTypeColumn(member); writeNameColumn(member); writeValue(member); trEnd(); }
public ClassDescription(ClassDoc classDoc, ClassDescriptionSource source) { this.classDoc = classDoc; loadEvents(); loadParameters(source); ClassDoc parentDoc = classDoc.superclass(); if (parentDoc != null) { ClassDescription parentDescription = source.getDescription(classDoc.superclass().qualifiedName()); mergeInto(events, parentDescription.events); mergeInto(parameters, parentDescription.parameters); } }