Generate the text to go into the seeTag link

@param str link
@param Doclet doclet
183747
public function _linkText($link, $doclet)
    {
        $element =& $this->_resolveLink();
        if ($element && $this->_parent) {
            $package =& $this->_parent->containingPackage();
            $path = str_repeat('../', $package->depth() + 1).$element->asPath();

            return $doclet->formatLink($path, $link);
        } elseif (preg_match('/^(https?|ftp):\/\//', $this->_link) === 1) {
            return $doclet->formatLink($this->_link, $link);
        } else {
            return $link;
        }
    }
1203360
function registerLink(doclet) {
  var url = helper.createLink(doclet);
  helper.registerLink(doclet.longname, url);
  doclet.rstLink = url.substr(0, url.length - helper.fileExtension.length);

  // Parent link
  if (!doclet.memberof) {
    return;
  }
  var parent;
  parent = helper.find(context.data, {longname: doclet.memberof});
  if (parent && parent.length > 0) {
    doclet.parentRstLink = parent[0].rstLink;
  }
  // Reference code
  doclet.rstReference = doclet.parentRstLink + '.' + doclet.name;
}
159977
protected void generateHelpFile() throws IOException {
        String title = configuration.getText("doclet.Window_Help_title");
        Content body = getBody(true, getWindowTitle(title));
        addTop(body);
        addNavLinks(true, body);
        addHelpFileContents(body);
        addNavLinks(false, body);
        addBottom(body);
        printHtmlDocument(null, true, body);
    }
117466
private static String linkToHtml( Link l ){
		if( l == null ) {
			return "null";
		}

		StringBuilder result = new StringBuilder();

		result.append("<div class=\"Link\"><b class=\"Link\">Link:</b>" +
				l.getType() + ": \"" +
				convertTags( l.getText() )+ "\" -> \"" + convertTags( l.getTarget() ) +"\"");

		if( l.getParameters().size() != 0 ){
			for( String parameter: l.getParameters() ) {
				result.append("<br>\nPARAMETER: \""+convertTags( parameter )+"\"");
			}
		}

		result.append("</div>\n");

		return result.toString();
	}
574463
public function frameOutputWriter(&$doclet)
    {

        parent::HTMLWriter($doclet);

        ob_start();
        echo <<<END

<frameset cols="20%,80%" frameborder="1" border="1" bordercolor="#bbb" framespacing="1">

<frame src="frame.html" name="index">
<frame src="namespaces.html" name="main">

<noframes>
    <body>
        <h2>Frame Alert</h2>
        <p>This document is designed to be viewed using frames. If you see this message, you are using a non-frame-capable browser.<br>
        Link to <a href="namespaces.html">Non-frame version</a>.</p>
    </body>
</noframes>

</frameset>
END;

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

        $this->_write('index.html', false, false, false);

    }
645960
private void parseSeeString() {
        int len = text.length();
        if (len == 0) {
            return;
        }
        switch (text.charAt(0)) {
            case '<':
                if (text.charAt(len-1) != '>') {
                    docenv().warning(holder,
                                     "tag.see.no_close_bracket_on_url",
                                     name, text);
                }
                return;
            case '"':
                if (len == 1 || text.charAt(len-1) != '"') {
                    docenv().warning(holder,
                                     "tag.see.no_close_quote",
                                     name, text);
                } else {
//                    text = text.substring(1,len-1); // strip quotes
                }
                return;
        }

        // check that the text is one word, with possible parentheses
        // this part of code doesn't allow
        // @see <a href=.....>asfd</a>
        // comment it.

        // the code assumes that there is no initial white space.
        int parens = 0;
        int commentstart = 0;
        int start = 0;
        int cp;
        for (int i = start; i < len ; i += Character.charCount(cp)) {
            cp = text.codePointAt(i);
            switch (cp) {
                case '(': parens++; break;
                case ')': parens--; break;
                case '[': case ']': case '.': case '#': break;
                case ',':
                    if (parens <= 0) {
                        docenv().warning(holder,
                                         "tag.see.malformed_see_tag",
                                         name, text);
                        return;
                    }
                    break;
                case ' ': case '\t': case '\n': case CR:
                    if (parens == 0) { //here onwards the comment starts.
                        commentstart = i;
                        i = len;
                    }
                    break;
                default:
                    if (!Character.isJavaIdentifierPart(cp)) {
                        docenv().warning(holder,
                                         "tag.see.illegal_character",
                                         name, ""+cp, text);
                    }
                    break;
            }
        }
        if (parens != 0) {
            docenv().warning(holder,
                             "tag.see.malformed_see_tag",
                             name, text);
            return;
        }

        String seetext = "";
        String labeltext = "";

        if (commentstart > 0) {
            seetext = text.substring(start, commentstart);
            labeltext = text.substring(commentstart + 1);
            // strip off the white space which can be between seetext and the
            // actual label.
            for (int i = 0; i < labeltext.length(); i++) {
                char ch2 = labeltext.charAt(i);
                if (!(ch2 == ' ' || ch2 == '\t' || ch2 == '\n')) {
                    label = labeltext.substring(i);
                    break;
                }
            }
        } else {
            seetext = text;
            label = "";
        }

        int sharp = seetext.indexOf('#');
        if (sharp >= 0) {
            // class#member
            where = seetext.substring(0, sharp);
            what = seetext.substring(sharp + 1);
        } else {
            if (seetext.indexOf('(') >= 0) {
                docenv().warning(holder,
                                 "tag.see.missing_sharp",
                                 name, text);
                where = "";
                what = seetext;
            }
            else {
                // no member specified, text names class
                where = seetext;
                what = null;
            }
        }
    }
588131
private void checkTaglet(Object taglet) {
        if (taglet instanceof Taglet) {
            checkTagName(((Taglet) taglet).getName());
        } else if (taglet instanceof jdk.javadoc.doclet.Taglet) {
            jdk.javadoc.doclet.Taglet legacyTaglet = (jdk.javadoc.doclet.Taglet) taglet;
            customTags.remove(legacyTaglet.getName());
            customTags.put(legacyTaglet.getName(), new UserTaglet(legacyTaglet));
            checkTagName(legacyTaglet.getName());
        } else {
            throw new IllegalArgumentException("Given object is not a taglet.");
        }
    }
1034967
@Override
  protected void visitRawTextNode(RawTextNode node) {
    // Escape special characters in the text before writing as a string.
    String exprText = BaseUtils.escapeToSoyString(node.getRawText(), false, QuoteStyle.SINGLE);
    pyExprs.add(new PyStringExpr(exprText));
  }
717152
private void transformTag(StringBuffer target, SourceCode cfml, Tag tag, URL url) throws MalformedURLException {
	// TODO attribute inside other attribute

	char quote = 0;
	boolean inside = false;
	StringBuffer value = new StringBuffer();

	while (!cfml.isAfterLast()) {
	    if (inside) {
		if (quote != 0 && cfml.forwardIfCurrent(quote)) {
		    inside = false;
		    target.append(add(url, value.toString()));
		    target.append(quote);
		}
		else if (quote == 0 && (cfml.isCurrent(' ') || cfml.isCurrent("/>") || cfml.isCurrent('>') || cfml.isCurrent('\t') || cfml.isCurrent('\n'))) {

		    inside = false;
		    target.append(new URL(url, value.toString()));
		    target.append(cfml.getCurrent());
		    cfml.next();
		}
		else {
		    value.append(cfml.getCurrent());
		    cfml.next();
		}
	    }
	    else if (cfml.forwardIfCurrent('>')) {
		target.append('>');
		break;
	    }
	    else {

		for (int i = 0; i < tag.attributes.length; i++) {
		    if (cfml.forwardIfCurrent(tag.attributes[i])) {
			target.append(tag.attributes[i]);
			cfml.removeSpace();
			// =
			if (cfml.isCurrent('=')) {
			    inside = true;
			    target.append('=');
			    cfml.next();
			    cfml.removeSpace();

			    quote = cfml.getCurrent();
			    value = new StringBuffer();
			    if (quote != '"' && quote != '\'') quote = 0;
			    else {
				target.append(quote);
				cfml.next();
			    }
			}
		    }
		}
		if (!inside) {
		    target.append(cfml.getCurrent());
		    cfml.next();
		}
	    }
	}
    }
460805
private Tag setupDocument(final HttpServletRequest request, final Document doc) {

		final Tag head = doc.block("head");

		head.block("title").text(TITLE);
		head.empty("meta").attr(new Attr("http-equiv", "Content-Type"), new Attr("content", "text/html;charset=utf-8"));
		head.empty("meta").attr(new Name("viewport"), new Attr("content", "width=1024, user-scalable=yes"));
		head.empty("link").attr(new Rel("stylesheet"), new Href("/structr/css/lib/jquery-ui-1.10.3.custom.min.css"));
		head.empty("link").attr(new Rel("stylesheet"), new Href("/structr/css/main.css"));
		head.empty("link").attr(new Rel("stylesheet"), new Href("/structr/css/sprites.css"));
		head.empty("link").attr(new Rel("stylesheet"), new Href("/structr/css/config.css"));
		head.empty("link").attr(new Rel("icon"), new Href("favicon.ico"), new Type("image/x-icon"));
		head.block("script").attr(new Src("/structr/js/lib/jquery-3.3.1.min.js"));
		head.block("script").attr(new Src("/structr/js/icons.js"));
		head.block("script").attr(new Src("/structr/js/config.js"));

		final Tag body = doc.block("body");
		final Tag header = body.block("div").id("header");

		header.block("i").css("logo sprite sprite-structr-logo");
		final Tag links = header.block("div").id("menu").css("menu").block("ul");

		if (isAuthenticated(request)) {

			final Tag form = links.block("li").block("form").attr(new Attr("action", ConfigUrl), new Attr("method", "post"), new Style("display: none")).id("logout-form");

			form.empty("input").attr(new Type("hidden"), new Name("action"), new Value("logout"));
			links.block("a").text("Logout").attr(new Style("cursor: pointer"), new OnClick("$('#logout-form').submit();"));
		}

		return body;
	}
1128818
public static void withLink(Representation representation, String rel, String href, Predicate<ReadableRepresentation> predicate) {
        withLink(representation, rel, href,
                 Optional.of(predicate),
                 Optional.<String>absent(),
                 Optional.<String>absent(),
                 Optional.<String>absent(),
                 Optional.<String>absent());
    }
166218
function(text, link) {
    var href = link.url
      , external = link.external || this.options.externalLinks;
    if (!href)
      href = link.toString();
    this.out.push("<a href=\"" + href + "\"");
    if (link.title)
      this.out.push(" title=\"" + escapeHtml(link.title) + "\"");
    if (external)
      this.out.push(" target=\"_blank\"");
    // Link text is rendered separately with the same options
    var html = new InlineCompiler(this.options).toHtml(text);
    this.out.push(">" + html + "</a>");
  }
339475
private void writeLinktext(final String navtitle) throws SAXException {
        final AttributesImpl atts = new AttributesImpl();
        XMLUtils.addOrSetAttribute(atts, ATTRIBUTE_NAME_CLASS, TOPIC_LINKTEXT.toString());
        getContentHandler().startElement(NULL_NS_URI, TOPIC_LINKTEXT.localName, TOPIC_LINKTEXT.localName, atts);
        final char[] ch = navtitle.toCharArray();
        getContentHandler().characters(ch, 0, ch.length);
        getContentHandler().endElement(NULL_NS_URI, TOPIC_LINKTEXT.localName, TOPIC_LINKTEXT.localName);
    }
611467
public static Text toText(Document doc, Object o) throws PageException {
	if (o instanceof Text) return (Text) o;
	else if (o instanceof CharacterData) return doc.createTextNode(((CharacterData) o).getData());
	return doc.createTextNode(Caster.toString(o));
    }
939120
public String asString(Document doc) {
        try {
            DOMSource domSource = new DOMSource(doc);
            StringWriter writer = new StringWriter();
            StreamResult result = new StreamResult(writer);
            TransformerFactory tf = TransformerFactory.newInstance();
            Transformer transformer = tf.newTransformer();
            transformer.transform(domSource, result);
            return writer.toString();
        } catch (TransformerException e) {
            throw new IllegalStateException(e);
        }
    }
1299563
public boolean parseHtmlTag(PrintWriter out, String strTag, String strParams, String strData)
    {
        return false;   // Tag not found
    }
208595
public void openTag(final QName tag,
                      final String attrName,
                      final String attrVal) throws IOException {
    blanks();
    openTagSameLine(tag, attrName, attrVal);
    newline();
    indent += 2;
  }