当前位置: 首页>>代码示例>>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;未经允许,请勿转载。