Adds api doc roots from a link. The folder reffered by the link should contain a package-list
file that will be parsed in order to add api doc roots to this configuration
@param packageListUrl
434133
private void addApiDocRoots(String packageListUrl) {
	BufferedReader br = null;
	packageListUrl = fixApiDocRoot(packageListUrl);
	try {
	    URL url = new URL(packageListUrl + "/package-list");
	    br = new BufferedReader(new InputStreamReader(url.openStream()));
	    String line;
	    while((line = br.readLine()) != null) {
		line = line + ".";
		Pattern pattern = Pattern.compile(line.replace(".", "\\.") + "[^\\.]*");
		apiDocMap.put(pattern, packageListUrl);
	    }
	} catch(IOException e) {
	    System.err.println("Errors happened while accessing the package-list file at "
		    + packageListUrl);
	} finally {
	    if(br != null)
		try {
		    br.close();
		} catch (IOException e) {}
	}
	
    }
454034
@Override
    public Context addWebapp(Host host, String contextPath, String docBase) {
        final ContextConfig contextConfig = createContextConfig(); // *extension point
        return addWebapp(host, contextPath, docBase, contextConfig);
    }
543364
protected void addPackageAnnotationList(Content contentTree) {
        if (!utils.isAnnotationType(typeElement) ||
                pkgToPackageAnnotations == null ||
                pkgToPackageAnnotations.isEmpty()) {
            return;
        }
        Content caption = getTableCaption(configuration.getContent(
                "doclet.ClassUse_PackageAnnotation",
                getLink(new LinkInfoImpl(configuration,
                        LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement))));
        Content table = (configuration.isOutputHtml5())
                ? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
                : HtmlTree.TABLE(HtmlStyle.useSummary, useTableSummary, caption);
        table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
        Content tbody = new HtmlTree(HtmlTag.TBODY);
        boolean altColor = true;
        for (PackageElement pkg : pkgToPackageAnnotations) {
            HtmlTree tr = new HtmlTree(HtmlTag.TR);
            tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
            altColor = !altColor;
            Content thFirst = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, getPackageLink(pkg));
            tr.addContent(thFirst);
            HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
            tdLast.addStyle(HtmlStyle.colLast);
            addSummaryComment(pkg, tdLast);
            tr.addContent(tdLast);
            tbody.addContent(tr);
        }
        table.addContent(tbody);
        Content li = HtmlTree.LI(HtmlStyle.blockList, table);
        contentTree.addContent(li);
    }
754718
public static void addToClasspath(final String url, final ClassLoader classLoader) {
        checkNotNull("url", url);
        try {
            addToClasspath(new URL(url), classLoader);
        } catch (final MalformedURLException e) {
            throw new RuntimeException(e);
        }
    }
458763
protected void addPackageList(Content contentTree) throws IOException {
        Content caption = getTableCaption(configuration.getResource(
                "doclet.ClassUse_Packages.that.use.0",
                getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc))));
        Content table = (configuration.isOutputHtml5())
                ? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
                : HtmlTree.TABLE(HtmlStyle.useSummary, useTableSummary, caption);
        table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
        Content tbody = new HtmlTree(HtmlTag.TBODY);
        Iterator<PackageDoc> it = pkgSet.iterator();
        for (int i = 0; it.hasNext(); i++) {
            PackageDoc pkg = it.next();
            HtmlTree tr = new HtmlTree(HtmlTag.TR);
            if (i % 2 == 0) {
                tr.addStyle(HtmlStyle.altColor);
            } else {
                tr.addStyle(HtmlStyle.rowColor);
            }
            addPackageUse(pkg, tr);
            tbody.addContent(tr);
        }
        table.addContent(tbody);
        Content li = HtmlTree.LI(HtmlStyle.blockList, table);
        contentTree.addContent(li);
    }
308133
protected void buildIndexMap(RootDoc root)  {
        PackageDoc[] packages = root.specifiedPackages();
        ClassDoc[] classes = root.classes();
        if (!classesOnly) {
            if (packages.length == 0) {
                Set<PackageDoc> set = new HashSet<PackageDoc>();
                PackageDoc pd;
                for (int i = 0; i < classes.length; i++) {
                    pd = classes[i].containingPackage();
                    if (pd != null && pd.name().length() > 0) {
                        set.add(pd);
                    }
                }
                adjustIndexMap(set.toArray(packages));
            } else {
                adjustIndexMap(packages);
            }
        }
        adjustIndexMap(classes);
        if (!classesOnly) {
            for (int i = 0; i < classes.length; i++) {
                if (shouldAddToIndexMap(classes[i])) {
                    putMembersInIndexMap(classes[i]);
                }
            }
        }
        sortIndexMap();
    }
702132
@Override
    public T addAsManifestResource(Package resourcePackage, String resourceName) throws IllegalArgumentException {
        Validate.notNull(resourcePackage, "ResourcePackage must be specified");
        Validate.notNull(resourceName, "ResourceName must be specified");

        String classloaderResourceName = AssetUtil.getClassLoaderResourceName(resourcePackage, resourceName);
        ArchivePath target = ArchivePaths.create(classloaderResourceName);

        return addAsManifestResource(resourcePackage, resourceName, target);
    }
1111357
protected void addPackageTreeLinks(Content contentTree) {
        //Do nothing if only unnamed package is used
        if (isUnnamedPackage()) {
            return;
        }
        if (!classesonly) {
            Content span = HtmlTree.SPAN(HtmlStyle.packageHierarchyLabel,
                    getResource("doclet.Package_Hierarchies"));
            contentTree.addContent(span);
            HtmlTree ul = new HtmlTree(HtmlTag.UL);
            ul.addStyle(HtmlStyle.horizontal);
            int i = 0;
            for (PackageDoc pkg : packages) {
                // If the package name length is 0 or if -nodeprecated option
                // is set and the package is marked as deprecated, do not include
                // the page in the list of package hierarchies.
                if (pkg.name().isEmpty() ||
                        (configuration.nodeprecated && utils.isDeprecated(pkg))) {
                    i++;
                    continue;
                }
                DocPath link = pathString(pkg, DocPaths.PACKAGE_TREE);
                Content li = HtmlTree.LI(getHyperLink(
                        link, new StringContent(pkg.name())));
                if (i < packages.size() - 1) {
                    li.addContent(", ");
                }
                ul.addContent(li);
                i++;
            }
            contentTree.addContent(ul);
        }
    }
1217756
protected void addDescription(PackageDoc pkg, Content dlTree, SearchIndexItem si) {
        Content link = getPackageLink(pkg, new StringContent(utils.getPackageName(pkg)));
        si.setLabel(utils.getPackageName(pkg));
        si.setCategory(getResource("doclet.Packages").toString());
        Content dt = HtmlTree.DT(link);
        dt.addContent(" - ");
        dt.addContent(getResource("doclet.package"));
        dt.addContent(" " + pkg.name());
        dlTree.addContent(dt);
        Content dd = new HtmlTree(HtmlTag.DD);
        addSummaryComment(pkg, dd);
        dlTree.addContent(dd);
    }
942115
protected void addAllClassesLink(Content ul) {
        Content linkContent = getHyperLink(DocPaths.ALLCLASSES_FRAME,
                allclassesLabel, "", "packageFrame");
        Content li = HtmlTree.LI(linkContent);
        ul.addContent(li);
    }
759107
protected void addClassList(Content contentTree) throws IOException {
        HtmlTree ul = new HtmlTree(HtmlTag.UL);
        ul.addStyle(HtmlStyle.blockList);
        for (Iterator<PackageDoc> it = pkgSet.iterator(); it.hasNext();) {
            PackageDoc pkg = it.next();
            Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(pkg.name()));
            Content link = getResource("doclet.ClassUse_Uses.of.0.in.1",
                    getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER,
                    classdoc)),
                    getPackageLink(pkg, Util.getPackageName(pkg)));
            Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link);
            li.addContent(heading);
            addClassUse(pkg, li);
            ul.addContent(li);
        }
        Content li = HtmlTree.LI(HtmlStyle.blockList, ul);
        contentTree.addContent(li);
    }
1320059
@Override
    public void add(URL url, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException {
        if(notNull(baseURI)) {
            getClient().sendAdd(new URL(url.toString()).openStream(), baseURI, dataFormat, contexts);
        }else{
            getClient().sendAdd(new URL(url.toString()).openStream(), url.toString(), dataFormat, contexts);
        }
    }
1330553
public static void addEnvContextParam(Document doc, Element root) {
    Element ctxParam = doc.createElement("context-param");
    Element paramName = doc.createElement("param-name");
    paramName.appendChild(doc.createTextNode("shiroEnvironmentClass"));
    ctxParam.appendChild(paramName);
    Element paramValue = doc.createElement("param-value");
    paramValue.appendChild(doc.createTextNode("com.meltmedia.cadmium.servlets.shiro.WebEnvironment"));
    ctxParam.appendChild(paramValue);

    addRelativeTo(root, ctxParam, "listener", false);
  }
847700
function packageWriter(&$doclet) {

        parent::MDWriter($doclet);

        $rootDoc = & $this->_doclet->rootDoc();
        $phpdoctor = & $this->_doclet->phpdoctor();

        $displayTree = $phpdoctor->getOption("tree");

        if ($displayTree) {
            $this->_id = "tree";

            $tree = array();
            $classes = & $rootDoc->classes();
            if ($classes) {
                foreach ($classes as $class) {
                    $this->_buildTree($tree, $class);
                }
            }

            ob_start();

            echo "\n\n- - -\n\n";
            echo "#Class Hierarchy#\n\n";

            $this->_displayTree($tree);

            $this->_output = ob_get_contents();
            ob_end_clean();

            $this->_write("overview-tree.md");
        }

        $this->_id = "package";

        $packages = & $rootDoc->packages();
        ksort($packages);

        foreach ($packages as $packageName => $package) {

            $this->_depth = $package->depth() + 1;

            ob_start();

            echo "\n\n- - -\n\n";

            echo "#Namespace ", $package->name(), "#\n\n";

            if ($displayTree) {
                echo "<div><a href='{$this->_asURL($package)}/package-tree.md'>View Class Hierarchy for this Package</a></div>\n\n";
            }

            $textTag = & $package->tags("@text");
            if ($textTag) {
                echo "<div class=\"comment\">", $this->_processInlineTags($textTag, TRUE), "</div>\n\n";
                echo "<dl><dt>See:</dt><dd><b><a href=\"#overview_description\">Description</a></b></dd></dl>", "\n\n";
            }

            $classes = & $package->ordinaryClasses();
            if ($classes) {
                ksort($classes);
                echo "<table class=\"title\">", "\n";
                echo "<tr><th colspan=\"2\" class=\"title\">Class Summary</th></tr>", "\n";
                foreach ($classes as $name => $class) {
                    $textTag = & $classes[$name]->tags("@text");
                    echo "<tr><td class=\"name\"><a href=\"", $this->_asURL($classes[$name]), "\">", $classes[$name]->name(), "</a></td>";
                    echo "<td class=\"description\">";
                    if ($textTag)
                        echo strip_tags($this->_processInlineTags($textTag, TRUE), "<a><b>**<u><em>");
                    echo "</td></tr>\n";
                }
                echo "</table>\n\n";
            }

            $interfaces = & $package->interfaces();
            if ($interfaces) {
                ksort($interfaces);
                echo "<table class=\"title\">" . "\n";
                echo "<tr><th colspan=\"2\" class=\"title\">Interface Summary</th></tr>" . "\n";
                foreach ($interfaces as $name => $interface) {
                    $textTag = & $interfaces[$name]->tags("@text");
                    echo "<tr><td class=\"name\"><a href=\"", $this->_asURL($interfaces[$name]), "\">", $interfaces[$name]->name(), "</a></td>";
                    echo "<td class=\"description\">";
                    if ($textTag)
                        echo strip_tags($this->_processInlineTags($textTag, TRUE), "<a><b>**<u><em>");
                    echo "</td></tr>\n";
                }
                echo "</table>\n\n";
            }

            $exceptions = & $package->exceptions();
            if ($exceptions) {
                ksort($exceptions);
                echo "<table class=\"title\">" . "\n";
                echo "<tr><th colspan=\"2\" class=\"title\">Exception Summary</th></tr>" . "\n";
                foreach ($exceptions as $name => $exception) {
                    $textTag = & $exceptions[$name]->tags("@text");
                    echo "<tr><td class=\"name\"><a href=\"", $this->_asURL($exceptions[$name]), "\">", $exceptions[$name]->name(), "</a></td>";
                    echo "<td class=\"description\">";
                    if ($textTag)
                        echo strip_tags($this->_processInlineTags($textTag, TRUE), "<a><b>**<u><em>");
                    echo "</td></tr>\n";
                }
                echo "</table>\n\n";
            }

            $functions = & $package->functions();
            if ($functions) {
                ksort($functions);
                echo "<table class=\"title\">", "\n";
                echo "<tr><th colspan=\"2\" class=\"title\">Function Summary</th></tr>", "\n";
                foreach ($functions as $name => $function) {
                    $textTag = & $functions[$name]->tags("@text");
                    echo "<tr><td class=\"name\"><a href=\"package-functions.md#", $functions[$name]->name(), "\">", $functions[$name]->name(), "</a></td>";
                    echo "<td class=\"description\">";
                    if ($textTag)
                        echo strip_tags($this->_processInlineTags($textTag, TRUE), "<a><b>**<u><em>");
                    echo "</td></tr>\n";
                }
                echo "</table>\n\n";
            }

            $globals = & $package->globals();
            if ($globals) {
                ksort($globals);
                echo "<table class=\"title\">", "\n";
                echo "<tr><th colspan=\"2\" class=\"title\">Global Summary</th></tr>", "\n";
                foreach ($globals as $name => $global) {
                    $textTag = & $globals[$name]->tags("@text");
                    echo "<tr><td class=\"name\"><a href=\"package-globals.md#", $globals[$name]->name(), "\">", $globals[$name]->name(), "</a></td>";
                    echo "<td class=\"description\">";
                    if ($textTag)
                        echo strip_tags($this->_processInlineTags($textTag, TRUE), "<a><b>**<u><em>");
                    echo "</td></tr>\n";
                }
                echo "</table>\n\n";
            }

            $textTag = & $package->tags("@text");
            if ($textTag) {
                echo "#Namespace ", $package->name(), " Description#\n\n";
                echo "<div class=\"comment\" id=\"overview_description\">" . $this->_processInlineTags($textTag), "</div>\n\n";
            }

            echo "- - -\n\n";

            $this->_output = ob_get_contents();
            ob_end_clean();

            $this->_write($this->_normalize($package->_name) . "_README.md");

            if ($displayTree) {
                $this->_id = "tree";

                $tree = array();
                $classes = & $package->ordinaryClasses();
                if ($classes) {
                    ksort($classes);
                    foreach ($classes as $class) {
                        $this->_buildTree($tree, $class);
                    }
                }

                ob_start();

                echo "- - -\n\n";

                echo "#Class Hierarchy for Package {$package->name()}";
                echo "\n\n<div><a href='{$this->_asURL($package)}'>Back to package summary</a></div>\n\n";

                $this->_displayTree($tree);

                $this->_output = ob_get_contents();
                ob_end_clean();

                $this->_write($this->_normalize($package->_name) . "_package-tree.md", $package->name(), TRUE);
            }
        }
    }
1028189
public static void addToClasspath(final URL url, final ClassLoader classLoader) {
        checkNotNull("url", url);
        checkNotNull("classLoader", classLoader);
        if (!(classLoader instanceof URLClassLoader)) {
            throw new IllegalArgumentException("Cannot add '" + url + "' to classloader because it's not an URL classloader");
        }
        final URLClassLoader urlClassLoader = (URLClassLoader) classLoader;
        if (!containsURL(urlClassLoader.getURLs(), url)) {
            try {

                final Method addURL = URLClassLoader.class.getDeclaredMethod("addURL", new Class[] { URL.class });
                addURL.setAccessible(true);
                addURL.invoke(urlClassLoader, new Object[] { url });
            } catch (final NoSuchMethodException e) {
                throw new RuntimeException(e);
            } catch (final IllegalArgumentException e) {
                throw new RuntimeException(e);
            } catch (final IllegalAccessException e) {
                throw new RuntimeException(e);
            } catch (final InvocationTargetException e) {
                throw new RuntimeException(e);
            }
        }
    }
139199
public void addImportedPackages(String... importedPackages) {
		String oldBundles = mainAttributes.get(IMPORT_PACKAGE);
		if (oldBundles == null)
			oldBundles = "";
		BundleList oldResultList = BundleList.fromInput(oldBundles, newline);
		BundleList resultList = BundleList.fromInput(oldBundles, newline);
		for (String bundle : importedPackages)
			resultList.mergeInto(Bundle.fromInput(bundle));
		String result = resultList.toString();
		boolean changed = !oldResultList.toString().equals(result);
		modified |= changed;
		if (changed)
			mainAttributes.put(IMPORT_PACKAGE, result);
	}
274946
protected void addClassList(Content contentTree) {
        List<String> classTableHeader = Arrays.asList(
                resources.getText("doclet.Class"), resources.getText("doclet.Description"));
        for (String packageName : usingPackageToUsedClasses.keySet()) {
            PackageElement usingPackage = utils.elementUtils.getPackageElement(packageName);
            HtmlTree li = new HtmlTree(HtmlTag.LI);
            li.addStyle(HtmlStyle.blockList);
            if (usingPackage != null) {
                li.addContent(getMarkerAnchor(utils.getPackageName(usingPackage)));
            }
            String tableSummary = configuration.getText("doclet.Use_Table_Summary",
                                                        configuration.getText("doclet.classes"));
            Content caption = getTableCaption(configuration.getContent(
                    "doclet.ClassUse_Classes.in.0.used.by.1",
                    getPackageLink(packageElement, utils.getPackageName(packageElement)),
                    getPackageLink(usingPackage, utils.getPackageName(usingPackage))));
            Content table = (configuration.isOutputHtml5())
                    ? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
                    : HtmlTree.TABLE(HtmlStyle.useSummary, tableSummary, caption);
            table.addContent(getSummaryTableHeader(classTableHeader, "col"));
            Content tbody = new HtmlTree(HtmlTag.TBODY);
            boolean altColor = true;
            for (TypeElement te : usingPackageToUsedClasses.get(packageName)) {
                HtmlTree tr = new HtmlTree(HtmlTag.TR);
                tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
                altColor = !altColor;
                addClassRow(te, usingPackage, tr);
                tbody.addContent(tr);
            }
            table.addContent(tbody);
            li.addContent(table);
            contentTree.addContent(li);
        }
    }