/** * Initialize the taglet manager. The strings to initialize the simple custom tags should be in * the following format: "[tag name]:[location str]:[heading]". * * @param customTagStrs the set two dimentional arrays of strings. These arrays contain either * -tag or -taglet arguments. */ private void initTagletManager(Set customTagStrs) { tagletManager = tagletManager == null ? new TagletManager(nosince, showversion, showauthor, message) : tagletManager; String[] args; for (Iterator it = customTagStrs.iterator(); it.hasNext(); ) { args = (String[]) it.next(); if (args[0].equals("-taglet")) { tagletManager.addCustomTag(args[1], tagletpath); continue; } String[] tokens = Util.tokenize(args[1], TagletManager.SIMPLE_TAGLET_OPT_SEPERATOR, 3); if (tokens.length == 1) { String tagName = args[1]; if (tagletManager.isKnownCustomTag(tagName)) { // reorder a standard tag tagletManager.addNewSimpleCustomTag(tagName, null, ""); } else { // Create a simple tag with the heading that has the same name as the tag. StringBuffer heading = new StringBuffer(tagName + ":"); heading.setCharAt(0, Character.toUpperCase(tagName.charAt(0))); tagletManager.addNewSimpleCustomTag(tagName, heading.toString(), "a"); } } else if (tokens.length == 2) { // Add simple taglet without heading, probably to excluding it in the output. tagletManager.addNewSimpleCustomTag(tokens[0], tokens[1], ""); } else if (tokens.length >= 3) { tagletManager.addNewSimpleCustomTag(tokens[0], tokens[2], tokens[1]); } else { message.error("doclet.Error_invalid_custom_tag_argument", args[1]); } } }
public String getText(String key, String a1, String a2, String a3) { try { // Check the doclet specific properties file. return getDocletSpecificMsg().getText(key, a1, a2, a3); } catch (Exception e) { // Check the shared properties file. return message.getText(key, a1, a2, a3); } }
/** * Set the command line options supported by this configuration. * * @param options the two dimensional array of options. */ public void setOptions(String[][] options) { LinkedHashSet customTagStrs = new LinkedHashSet(); for (int oi = 0; oi < options.length; ++oi) { String[] os = options[oi]; String opt = os[0].toLowerCase(); if (opt.equals("-d")) { destDirName = addTrailingFileSep(os[1]); docFileDestDirName = destDirName; } else if (opt.equals("-docfilessubdirs")) { copydocfilesubdirs = true; } else if (opt.equals("-docencoding")) { docencoding = os[1]; } else if (opt.equals("-encoding")) { encoding = os[1]; } else if (opt.equals("-author")) { showauthor = true; } else if (opt.equals("-version")) { showversion = true; } else if (opt.equals("-nodeprecated")) { nodeprecated = true; } else if (opt.equals("-sourcepath")) { sourcepath = os[1]; } else if (opt.equals("-classpath") && sourcepath.length() == 0) { sourcepath = os[1]; } else if (opt.equals("-excludedocfilessubdir")) { addToSet(excludedDocFileDirs, os[1]); } else if (opt.equals("-noqualifier")) { addToSet(excludedQualifiers, os[1]); } else if (opt.equals("-linksource")) { linksource = true; } else if (opt.equals("-sourcetab")) { linksource = true; try { sourcetab = Integer.parseInt(os[1]); } catch (NumberFormatException e) { // Set to -1 so that warning will be printed // to indicate what is valid argument. sourcetab = -1; } if (sourcetab <= 0) { message.warning("doclet.sourcetab_warning"); sourcetab = DocletConstants.DEFAULT_TAB_STOP_LENGTH; } } else if (opt.equals("-notimestamp")) { notimestamp = true; } else if (opt.equals("-nocomment")) { nocomment = true; } else if (opt.equals("-tag") || opt.equals("-taglet")) { customTagStrs.add(os); } else if (opt.equals("-tagletpath")) { tagletpath = os[1]; } else if (opt.equals("-keywords")) { keywords = true; } else if (opt.equals("-serialwarn")) { serialwarn = true; } else if (opt.equals("-group")) { group.checkPackageGroups(os[1], os[2]); } else if (opt.equals("-link")) { String url = os[1]; extern.url(url, url, root, false); } else if (opt.equals("-linkoffline")) { String url = os[1]; String pkglisturl = os[2]; extern.url(url, pkglisturl, root, true); } } if (sourcepath.length() == 0) { sourcepath = System.getProperty("env.class.path") == null ? "" : System.getProperty("env.class.path"); } if (docencoding == null) { docencoding = encoding; } classDocCatalog = new ClassDocCatalog(root.specifiedClasses()); initTagletManager(customTagStrs); }