當前位置: 首頁>>代碼示例>>Java>>正文


Java RootDoc.options方法代碼示例

本文整理匯總了Java中com.sun.javadoc.RootDoc.options方法的典型用法代碼示例。如果您正苦於以下問題:Java RootDoc.options方法的具體用法?Java RootDoc.options怎麽用?Java RootDoc.options使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.sun.javadoc.RootDoc的用法示例。


在下文中一共展示了RootDoc.options方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: startDoc

import com.sun.javadoc.RootDoc; //導入方法依賴的package包/類
private boolean startDoc(RootDoc root) throws IOException {
    ClassDoc[] classes = root.classes();
    String[][] options = root.options();
    for (String[] op : options) {
        if (op[0].equals("destdir")) {
            destDir = op[1];
        }
    }
    for (ClassDoc clazz : classes) {
        processClass(clazz);
    }
    if (errorCount > 0) {
        throw new IOException("FAILED: " + errorCount + " errors found");
    }
    return true;
}
 
開發者ID:vdr007,項目名稱:ThriftyPaxos,代碼行數:17,代碼來源:Doclet.java

示例2: start

import com.sun.javadoc.RootDoc; //導入方法依賴的package包/類
public static boolean start(final RootDoc root) throws IOException, ClassNotFoundException {
	final Options opt = new Options(root.options());

	final Map<String, Factory> factories = new HashMap<>();
	final Map<String, String> typeAliases = new HashMap<>();
	final Map<String, ObjectType> types = loadBuiltInTypes(typeAliases);
	final Set<String> builtIns = new HashSet<>(types.keySet());


	for(final String factoryName: opt.factoryNames) {
		factories.put(factoryName, parseFactory(factoryName, root, types));
	}
	if(opt.json) { writeJson(opt.outputPath, types, builtIns); }
	if(opt.html) { writeHtml(opt.outputPath, types, factories); }
	return true;
}
 
開發者ID:emily-e,項目名稱:webframework,代碼行數:17,代碼來源:ScriptingObjectDoclet.java

示例3: start

import com.sun.javadoc.RootDoc; //導入方法依賴的package包/類
/** Specified for the Doclet API */
public static boolean start(RootDoc root) {
  PluginConfigDoclet doclet = new PluginConfigDoclet(root);
  boolean ok = true;
  for (String[] optionArr : root.options()) {
    String name = optionArr[0];
    OptionName on = OPTION_NAMES.get(name);
    if (on != null) {
      ImmutableList<String> values = ImmutableList.copyOf(
          Arrays.asList(optionArr).subList(1, optionArr.length));
      ok &= on.configure(doclet, values);
    }
  }

  doclet.run();
  ok &= doclet.okSoFar;

  return ok;
}
 
開發者ID:mikesamuel,項目名稱:closure-maven-plugin,代碼行數:20,代碼來源:PluginConfigDoclet.java

示例4: start

import com.sun.javadoc.RootDoc; //導入方法依賴的package包/類
/**
 * Generate documentation here.
 * This method is required for all doclets.
 *
 * @return true on success.
 */
public static boolean start(RootDoc root) {

    Configuration config = new Configuration(root.options());

    Collection<ClassDescriptor> classDescriptors = new ArrayList<ClassDescriptor>();

    for (Collector collector : collectors)
        classDescriptors.addAll(collector.getDescriptors(root));

    Writer writer;
    if (config.getOutputFormat().equals(SwaggerWriter.OUTPUT_OPTION_NAME))
        writer = new SwaggerWriter();
    else
        writer = new SimpleHtmlWriter();


    try {
        writer.write(classDescriptors, config);
        return true;
    } catch (IOException e) {
        e.printStackTrace();
        return false;
    }
}
 
開發者ID:calrissian,項目名稱:rest-doclet,代碼行數:31,代碼來源:RestDoclet.java

示例5: start

import com.sun.javadoc.RootDoc; //導入方法依賴的package包/類
public static boolean start(RootDoc root) {
  //look for debug flag
  for (String[] opts : root.options()) {
    for (String opt : opts) {
      if (opt.equals(DEBUG_SWITCH)) {
        debugMode = true;
      }
    }
  }

  logMessage("Running doclet " + ConfigStandardDoclet.class.getSimpleName());
  ClassDoc[] classes = root.classes();
  for (int i = 0; i < classes.length; ++i) {
    processDoc(classes[i]);
  }

  return true;
}
 
開發者ID:apache,項目名稱:tez,代碼行數:19,代碼來源:ConfigStandardDoclet.java

示例6: startDoc

import com.sun.javadoc.RootDoc; //導入方法依賴的package包/類
private boolean startDoc(RootDoc root) throws IOException {
    ClassDoc[] classes = root.classes();
    String[][] options = root.options();
    for (String[] op : options) {
        if (op[0].equals("dest")) {
            destFile = op[1];
        }
    }
    for (ClassDoc clazz : classes) {
        processClass(clazz);
    }
    resources.store(destFile);
    return true;
}
 
開發者ID:vdr007,項目名稱:ThriftyPaxos,代碼行數:15,代碼來源:ResourceDoclet.java

示例7: startProcessDocs

import com.sun.javadoc.RootDoc; //導入方法依賴的package包/類
/**
 * Extracts the contents of certain types of javadoc and adds them to an output file.
 *
 * @param rootDoc The documentation root.
 * @return Whether the JavaDoc run succeeded.
 * @throws java.io.IOException if output can't be written.
 */
protected boolean startProcessDocs(final RootDoc rootDoc) throws IOException {
    for (String[] options : rootDoc.options()) {
        parseOption(options);
    }

    // Make sure the user specified a settings directory OR that we should use the defaults.
    // Both are not allowed.
    // Neither are not allowed.
    if ( (useDefaultTemplates && isSettingsDirSet) ||
            (!useDefaultTemplates && !isSettingsDirSet)) {
        throw new RuntimeException("ERROR: must specify only ONE of: " + USE_DEFAULT_TEMPLATES_OPTION + " , " + SETTINGS_DIR_OPTION);
    }

    // Make sure we can use the directory for settings we have set:
    if (!useDefaultTemplates) {
        validateSettingsDir();
    }

    // Make sure we're in a good state to run:
    validateDocletStartingState();



    processDocs(rootDoc);
    return true;
}
 
開發者ID:broadinstitute,項目名稱:barclay,代碼行數:34,代碼來源:HelpDoclet.java

示例8: start

import com.sun.javadoc.RootDoc; //導入方法依賴的package包/類
/**
 * Start Doclet.
 *
 * @param root the root
 * @return the boolean
 */
public static boolean start(final RootDoc root) {
    final Options options = new Options(root.options());
    new LivingDocumentation(
        ContextMapDrawer.make(options),
        GlossaryWriter.make(options)
    ).createDocumentations(root);
    return true;
}
 
開發者ID:myunusov,項目名稱:maxur-ldoc,代碼行數:15,代碼來源:LivingDocumentation.java

示例9: start

import com.sun.javadoc.RootDoc; //導入方法依賴的package包/類
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;
}
 
開發者ID:girtel,項目名稱:Net2Plan,代碼行數:10,代碼來源:CreateBookSectionsTable.java

示例10: start

import com.sun.javadoc.RootDoc; //導入方法依賴的package包/類
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;
}
 
開發者ID:girtel,項目名稱:Net2Plan,代碼行數:10,代碼來源:CreateHTMLKeywords.java

示例11: start

import com.sun.javadoc.RootDoc; //導入方法依賴的package包/類
/** 
 * Start parsing using the standard HTML doclet
 * @param root the root of the document tree
 * @return true if the parsing is successful, or false if there is an error
 */
public static boolean start(RootDoc root) {
    HtmlDoclet doclet = new HtmlDoclet();
    
    // get the APIs from the arguments
    String[][] options = root.options();
    String[] types = null;
    for (String[] option : options) {
        if (option[0].toLowerCase().equals("-wonderlandapi")) {
            types = option[1].split(",");
            
            // convert to internal names
            for (int i = 0; i < types.length; i++) {
                types[i] = API_MAP.get(types[i].toLowerCase());
            }
        }
    }
    
    try {
        // wrap the root object
        ClassLoader loader = WonderlandDoclet.class.getClassLoader();
        Class<?>[] interfaces = new Class<?>[] { RootDoc.class };
        RootDocWrapper handler = new RootDocWrapper(root, types);
        RootDoc wrapper = 
                (RootDoc) Proxy.newProxyInstance(loader, interfaces, handler);
    
        // overwrite the configuration used by the standard doclet to
        // return our wrapped classes
        doclet.configuration.root = wrapper;
        doclet.configuration.packages = handler.wrappedPackages;
        
        // parse using the standard HTML doclet
        doclet.start(doclet, wrapper);
    } catch (Exception exc) {
        exc.printStackTrace();
        return false;
    }
    return true;
}
 
開發者ID:josmas,項目名稱:openwonderland,代碼行數:44,代碼來源:WonderlandDoclet.java

示例12: parse

import com.sun.javadoc.RootDoc; //導入方法依賴的package包/類
/**
 * Static factory.
 * 
 * @param rawOptions Raw options array to parse.
 * @return Built options instance.
 */
public static MarkletOptions parse(final RootDoc root) {
	final Map<String, String> options = new HashMap<>();
	// NOTE :	Work since we only have 2D option.
	//			Consider redesign option parsing if this predicate change.
	for (final String [] option : root.options()) {
		options.put(option[0], option[1]);
	}
	return new MarkletOptions(options);
}
 
開發者ID:Faylixe,項目名稱:marklet,代碼行數:16,代碼來源:MarkletOptions.java

示例13: readOutputDir

import com.sun.javadoc.RootDoc; //導入方法依賴的package包/類
protected static File readOutputDir(RootDoc root) {
    for (int i = 0; i < root.options().length; i++) {
        String[] opt = root.options()[i];
        if (opt[0].equals("-d")) {
            return new File(opt[1]);
        }
    }
    return new File(".");
}
 
開發者ID:viltgroup,項目名稱:minium,代碼行數:10,代碼來源:DocumentationDoclet.java

示例14: start

import com.sun.javadoc.RootDoc; //導入方法依賴的package包/類
/**
 * The entry point for the doclet
 */
public static boolean start(RootDoc root) {
  String[][] options = root.options();

  File outputFile = null;
  for (int i = 0; i < options.length; i++) {
    String[] option = options[i];
    if (option[0].equals("-output")) {
      outputFile = new File(option[1]);
    }
  }

  if (outputFile == null) {
    root.printError("Internal Error: No output file");
    return false;

  } else {
    root.printNotice("Generating " + outputFile);
  }

  try {
    PrintWriter pw = new PrintWriter(new FileWriter(outputFile));
    Formatter.center("GemFire Unit Test Summary", pw);
    Formatter.center(new Date().toString(), pw);
    pw.println("");

    ClassDoc[] classes = root.classes();
    Arrays.sort(classes, new Comparator() {
      public int compare(Object o1, Object o2) {
        ClassDoc c1 = (ClassDoc) o1;
        ClassDoc c2 = (ClassDoc) o2;
        return c1.qualifiedName().compareTo(c2.qualifiedName());
      }
    });
    for (int i = 0; i < classes.length; i++) {
      ClassDoc c = classes[i];
      if (!c.isAbstract() && isUnitTest(c)) {
        document(c, pw);
      }
    }

    pw.flush();
    pw.close();

  } catch (IOException ex) {
    StringWriter sw = new StringWriter();
    ex.printStackTrace(new PrintWriter(sw, true));
    root.printError(sw.toString());
    return false;
  }

  return true;
}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:56,代碼來源:UnitTestDoclet.java

示例15: startInstance

import com.sun.javadoc.RootDoc; //導入方法依賴的package包/類
private void startInstance(RootDoc rootDoc)
   throws DocletConfigurationException, IOException
{
   this.rootDoc = rootDoc;

   // Set the default Taglet order

   registerTaglet(new VersionTaglet());
   registerTaglet(new AuthorTaglet());
   registerTaglet(new SinceTaglet(getInlineTagRenderer()));
   registerTaglet(new StandardTaglet("serial"));
   registerTaglet(new StandardTaglet("deprecated"));
   registerTaglet(new StandardTaglet("see"));
   registerTaglet(new StandardTaglet("param"));
   registerTaglet(new StandardTaglet("return"));

   registerTaglet(new ValueTaglet());
   registerTaglet(new CodeTaglet());

   // Process command line options

   for (int i=0, ilim=rootDoc.options().length; i<ilim; ++i) {

      String[] optionArr = rootDoc.options()[i];
      String _optionTag = optionArr[0];

      DocletOption option = (DocletOption)nameToOptionMap.get(_optionTag.toLowerCase());

      if (null != option) {
         option.set(optionArr);
      }
   }

   // Enable/disable standard taglets based on user input

   AuthorTaglet.setTagletEnabled(optionAuthor.getValue());
   VersionTaglet.setTagletEnabled(optionVersion.getValue());
   SinceTaglet.setTagletEnabled(!optionNoSince.getValue());
   DeprecatedTaglet.setTagletEnabled(!optionNoDeprecated.getValue());

   if (!getTargetDirectory().exists()) {
      if (!getTargetDirectory().mkdirs()) {
         throw new DocletConfigurationException("Cannot create target directory "
                                                + getTargetDirectory());
      }
   }

   run();
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:50,代碼來源:AbstractDoclet.java


注:本文中的com.sun.javadoc.RootDoc.options方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。