public static boolean start(RootDoc root) { //iterate over all classes. HashMap<String, ClassInspect> inspects = new HashMap<>(root.classes().length); ClassDoc[] classes = root.classes(); for (ClassDoc classDoc : classes) { ClassInspect classInspect = new ClassInspect(classDoc.name(), ((ClassDocImpl) classDoc).type.toString(), classDoc.commentText()); inspects.put(classInspect.getFullName(), classInspect); classInspect.setMethods(getInspects(classDoc.methods())); classInspect.setConstructors(getInspects(classDoc.constructors())); } SerializeInspect serializeInspect = new SerializeInspect(); String json = serializeInspect.toJson(inspects); serializeInspect.saveToFile(json); return true; }
final ResourceDocType result = new ResourceDocType(); final ClassDoc[] classes = root.classes(); for (final ClassDoc classDoc : classes) { LOG.fine("Writing class " + classDoc.qualifiedTypeName());
pw.println(""); ClassDoc[] classes = root.classes(); Arrays.sort(classes, new Comparator() { @Override
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(); } } }
for (ClassDoc classDoc : ROOTDOC.classes()) { String type = classDoc.qualifiedTypeName(); String comment = filter.filterAndTruncate(classDoc.commentText());
import com.sun.javadoc.*; public class ListClass { public static boolean start(RootDoc root) { ClassDoc[] classes = root.classes(); for (int i = 0; i < classes.length; ++i) { System.out.println(classes[i]); } return true; } }
/** Return the ClassDoc for the specified class; null if not found. */ private static ClassDoc findClass(RootDoc root, String name) { ClassDoc[] classes = root.classes(); for (ClassDoc cd : classes) if(cd.name().equals(name)) return cd; return null; }
protected boolean checkForDeprecation( RootDoc root ) { ClassDoc[] classarr = root.classes(); for( int i = 0; i < classarr.length; i++ ) { if( isGeneratedDoc( classarr[i] ) ) { return true; } } return false; }
/** * Constructor. Build the Tree using the Root of this Javadoc run. * * @param root Root of the Document. * @param configuration The curren configuration of the doclet. */ public ClassTree(RootDoc root, Configuration configuration) { buildTree(root.classes(), configuration); }
public WrappedRootDoc(RootDoc wrapped) { this.wrapped = wrapped; ClassDoc[] classes = wrapped.classes(); wrappedClassDocs = new WrappedClassDoc[classes.length]; for (int i = 0; i < classes.length; i++) { wrappedClassDocs[i] = new WrappedClassDoc(classes[i]); } }
/** Return the ClassDoc for the specified class; null if not found. */ private static ClassDoc findClass(RootDoc root, String name) { ClassDoc[] classes = root.classes(); for (ClassDoc cd : classes) if(cd.name().equals(name)) return cd; return null; }
/** * Constructor. Build the Tree using the Root of this Javadoc run. * * @param root Root of the Document. * @param configuration The curren configuration of the doclet. */ public ClassTree(RootDoc root, Configuration configuration) { buildTree(root.classes(), configuration); }
public static void start(RootDoc root) { ClassDoc[] classes = root.classes(); for (ClassDoc cd : classes) { System.out.println("Class [" + cd + "] has the following methods"); for(MemberDoc md : cd.methods()) { System.out.println(" " + md); } } }
public static boolean start(RootDoc root) { String tagName = "net2plan.keywords"; String outputFolder = null; for (String [] option : root.options ()) if (option [0].equals ("-outputFolder")) outputFolder = option [1]; if (outputFolder == null) throw new RuntimeException ("You should indicate the output file"); writeContents(root.classes(), tagName , outputFolder); return true; }
public static boolean start(RootDoc root) { String tagName = "net2plan.ocnbooksections"; String outputFolder = null; for (String [] option : root.options ()) if (option [0].equals ("-outputFolder")) outputFolder = option [1]; if (outputFolder == null) throw new RuntimeException ("You should indicate the output file"); writeContents(root.classes(), tagName , outputFolder); return true; }
static Map<String, PackageDoc> getPackages(RootDoc root) { Map<String, PackageDoc> packages = new TreeMap<String, PackageDoc>(); for (ClassDoc c: root.classes()) { PackageDoc p = c.containingPackage(); if(!packages.containsKey(p.name())) { packages.put(p.name(), p); } } return packages; }
public static void show(){ if(null == root){ return ; } ClassDoc[] classes = root.classes(); for (int i = 0; i < classes.length; ++i) { new ExtClassDoc(classes[i]).output(System.out); } } /**
/** * Constructor. Build the Tree using the Root of this Javadoc run. * * @param configuration the configuration of the doclet. * @param noDeprecated Don't add deprecated classes in the class tree, if * true. */ public ClassTree(Configuration configuration, boolean noDeprecated) { configuration.message.notice("doclet.Building_Tree"); buildTree(configuration.root.classes(), configuration); }
/** * Constructor. Build the Tree using the Root of this Javadoc run. * * @param configuration the configuration of the doclet. * @param noDeprecated Don't add deprecated classes in the class tree, if * true. */ public ClassTree(Configuration configuration, boolean noDeprecated) { configuration.message.notice("doclet.Building_Tree"); buildTree(configuration.root.classes(), configuration); }
public static boolean start(RootDoc root) { String destinationDir = destinationDir(root.options()); ObjectMapper mapper = createObjectMapper(); for (ClassDoc classDoc : root.classes()) { ClassDocumentation cd = ClassDocumentation.fromClassDoc(classDoc); writeToFile(destinationDir, mapper, classDoc, cd); } return true; }