final String output = getOptionArg(root.options(), OPTION_OUTPUT); final String classpath = getOptionArg(root.options(), OPTION_CLASSPATH); Thread.currentThread().setContextClassLoader(ncl); final String docProcessorOption = getOptionArg(root.options(), OPTION_DOC_PROCESSORS); final String[] docProcessors = docProcessorOption != null ? docProcessorOption.split(":") : null; final DocProcessorWrapper docProcessor = new DocProcessorWrapper();
String[][] options = root.options();
public String[][] options() { return root.options(); }
public String[][] options() { return wrapped.options(); }
public DocletOptions(RootDoc rootDoc) { this(rootDoc.options()); }
public SwaggerModuleProducer(RootDoc rootDoc) { this.rootDoc = rootDoc; this.docletOptions = DocletOptions.parse(rootDoc.options(), rootDoc); }
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; }
/** * Creates a new resource extractor doclet. * @param rootDoc the documentation root. */ private ResourceBundleExtractorDoclet(RootDoc rootDoc) { this.rootDoc = rootDoc; this.classDocs = new TreeSet<>(); this.packageDocs = new TreeSet<>(); this.allDocs = new TreeSet<>(); for (final ClassDoc classDoc: rootDoc.classes()) { this.classDocs.add(classDoc); // Cache packages as we see them, since there's no direct way to iterate over packages. this.packageDocs.add(classDoc.containingPackage()); } this.allDocs.addAll(classDocs); this.allDocs.addAll(packageDocs); for(final String[] options: rootDoc.options()) { if(options[0].equals("-out")) this.outFile = new File(options[1]); if(options[0].equals("-build-timestamp")) this.buildTimestamp = options[1]; if (options[0].equals("-absolute-version")) this.absoluteVersion = options[1]; } }
public static boolean start(RootDoc rootDoc) { Map<String, String[]> options = Arrays .stream(rootDoc.options()) .collect(Collectors.toMap(s -> s[0], s -> s, (key1, key2) -> key1)); List<AbstractModule> modules = Orchid.findModules(options); modules.add(OrchidModule.of(RootDoc.class, rootDoc)); modules.add(new JavadocModule()); Orchid.getInstance(options).start(modules); return true; }
/** * Set the command line options supported by this configuration. * * @throws DocletAbortException */ public void setOptions() throws Fault { initPackageArray(); setOptions(root.options()); try { initProfiles(); } catch (Exception e) { throw new DocletAbortException(e); } setSpecificDocletOptions(root.options()); }
public ClassDocGraph(RootDoc root) { this.root = root; //get the colors for the categories for (final String[] option : root.options()) { if (OPTION_CATEGORY.equals(option[0])) { if (option.length == 2 || option[1].split(":").length < 2) { final String[] split = option[1].split(":"); String lineColor = null; if (split.length > 2) { lineColor = split[2]; } addCategory(split[0], split[1], lineColor); } else { root.printWarning("Bad " + OPTION_CATEGORY + ", Ignoring. Use format '" + OPTION_CATEGORY + " <category>[:<fillcolor>[:linecolor]]'"); } } } root.printNotice("Building graph for all classes..."); for (ClassDoc node: root.classes()) { addNode(node, true); } }
public static boolean start(RootDoc root) throws IOException { String dumpFileName = readOptions(root.options()); OutputStream os = Files.newOutputStream(Paths.get(dumpFileName)); Properties javaDocMap = new Properties(); for (ClassDoc classDoc : root.classes()) { javaDocMap.put(classDoc.toString(), classDoc.commentText()); for (MethodDoc method : classDoc.methods()) { javaDocMap.put(method.qualifiedName(), method.commentText()); for (ParamTag paramTag : method.paramTags()) { Parameter[] parameters = method.parameters(); for (int i = 0; i < parameters.length; ++i) { if (parameters[i].name().equals(paramTag.parameterName())) { javaDocMap.put(method.qualifiedName() + ".paramCommentTag." + i, paramTag.parameterComment()); } } } Tag[] retTags = method.tags("return"); if (retTags != null && retTags.length == 1) { Tag retTag = method.tags("return")[0]; javaDocMap.put(method.qualifiedName() + "." + "returnCommentTag", retTag.text()); } } } javaDocMap.store(os, ""); os.flush(); os.close(); return true; }
/** * Creates the base Options object. * This contains both the options specified on the command * line and the ones specified in the UMLOptions class, if available. * Also create the globally accessible commentOptions object. */ public static Options buildOptions(RootDoc root) { commentOptions = new Options(); commentOptions.setOptions(root.options()); commentOptions.setOptions(findClass(root, "UMLNoteOptions")); commentOptions.shape = Shape.NOTE; Options opt = new Options(); opt.setOptions(root.options()); opt.setOptions(findClass(root, "UMLOptions")); return opt; }
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; }
/** * Processes the JavaDoc documentation. * <p> * This method is required for all doclets. * * @see com.sun.javadoc.Doclet#start(RootDoc) * * @param rootDoc * The root of the documentation tree. * * @return <code>true</code> if processing was successful. */ public static boolean start(RootDoc rootDoc) { CommandLine commandLine = parseCommandLine(rootDoc.options()); Parser parser = new Parser(); root = parser.parseRootDoc(rootDoc); save(commandLine, root); return true; }
/** * Creates the base Options object. * This contains both the options specified on the command * line and the ones specified in the UMLOptions class, if available. * Also create the globally accessible commentOptions object. */ public static Options buildOptions(RootDoc root) { commentOptions = new Options(); commentOptions.setOptions(root.options()); commentOptions.setOptions(findClass(root, "UMLNoteOptions")); commentOptions.shape = new Shape("note"); Options opt = new Options(); opt.setOptions(root.options()); opt.setOptions(findClass(root, "UMLOptions")); return opt; }