Java Code Examples for com.sun.javadoc.Tag#text()

The following examples show how to use com.sun.javadoc.Tag#text() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PSOperatorDoc.java    From PrivacyStreams with Apache License 2.0 5 votes vote down vote up
private PSOperatorDoc(ClassDoc classDoc, MethodDoc methodDoc) {
        this.declaringClassDoc = classDoc;
        this.methodDoc = methodDoc;
        this.description = methodDoc.commentText().replace('\n', ' ');
        this.paramDesc = "";

        Tag[] paramTags = methodDoc.tags("param");
        for (Tag paramTag : paramTags) {
            String paraStr = paramTag.text();
            String paraName = paraStr.substring(0, paraStr.indexOf(' ')).replace('\n', ' ');;
            String paraDesc = paraStr.substring(paraStr.indexOf(' ') + 1).replace('\n', ' ');;
            this.paramDesc += "<br> - `" + paraName + "`: " + paraDesc;
        }

        this.returnType = methodDoc.returnType();
//        ParameterizedType returnType = methodDoc.returnType().asParameterizedType();
//        this.inputType = returnType.typeArguments()[0];
//        this.outputType = returnType.typeArguments()[1];
//        this.completeSignature = "Function<" + this.inputType + ", " + this.outputType + "> " + methodDoc.toString();

        String shortSignature = classDoc.name() + "." + methodDoc.name() + "(";
        boolean firstParameter = true;
        for (Parameter parameter : methodDoc.parameters()) {
            if (firstParameter) {
                shortSignature += Utils.getSimpleTypeName(parameter.type()) + " " + parameter.name();
                firstParameter = false;
            } else {
                shortSignature += ", " + Utils.getSimpleTypeName(parameter.type()) + " " + parameter.name();
            }
        }
        shortSignature += ")";
        this.shortSignature = shortSignature;
    }
 
Example 2
Source File: RefTaglet.java    From rapidminer-studio with GNU Affero General Public License v3.0 5 votes vote down vote up
private String[] split(Tag tag) {
	String[] splitted = tag.text().split("\\|");
	if (splitted.length != 2) {
		System.err.println("Usage: {@" + getName() + " latexref|html_human_readable_ref} (" + tag.position() + ")");
		return new String[] { tag.text(), tag.text() };
	} else {
		return splitted;
	}
}
 
Example 3
Source File: MathTaglet.java    From rapidminer-studio with GNU Affero General Public License v3.0 4 votes vote down vote up
public String toString(Tag tag) {
	return "<i>" + tag.text() + "</i>";
}
 
Example 4
Source File: MathTaglet.java    From rapidminer-studio with GNU Affero General Public License v3.0 4 votes vote down vote up
public String toTex(Tag tag) {
	return "$" + tag.text() + "$";
}
 
Example 5
Source File: CiteTaglet.java    From rapidminer-studio with GNU Affero General Public License v3.0 4 votes vote down vote up
public String toString(Tag tag) {
	return "[" + tag.text() + "]";
}
 
Example 6
Source File: CiteTaglet.java    From rapidminer-studio with GNU Affero General Public License v3.0 4 votes vote down vote up
public String toTex(Tag tag) {
	return "\\cite{" + tag.text() + "}";
}
 
Example 7
Source File: IgniteLinkTaglet.java    From ignite with Apache License 2.0 3 votes vote down vote up
/**
 * Given the <code>Tag</code> representation of this custom tag, return its string representation.
 * <p>
 * Input: org.apache.ignite.grid.spi.indexing.h2.GridH2IndexingSpi#setIndexCustomFunctionClasses(Class[])
 * <p>
 * Output: <a href="../../../../../org/apache/ignite/grid/spi/indexing/h2/GridH2IndexingSpi.html#
 * setIndexCustomFunctionClasses(java.lang.Class...)">
 * <code>GridH2IndexingSpi.setIndexCustomFunctionClasses(java.lang.Class[])</code></a>
 *
 * @param tag <code>Tag</code> representation of this custom tag.
 */
@Override public String toString(Tag tag) {
    if (tag.text() == null || tag.text().isEmpty())
        return "";

    File f = tag.position().file();

    String curClass = f == null ? "" : f.getAbsolutePath().replace(File.separator, ".");

    String packPref = "src.main.java.";

    int idx = curClass.indexOf(packPref);

    StringBuilder path = new StringBuilder();

    if (idx != -1) {
        curClass = curClass.substring(idx + packPref.length());

        for (int i = 0, n = curClass.split("\\.").length - 2; i < n; i++)
            path.append("../");
    }

    String[] tokens = tag.text().split("#");

    int lastIdx = tokens[0].lastIndexOf('.');

    String simpleClsName = lastIdx != -1 && lastIdx + 1 < tokens[0].length() ?
        tokens[0].substring(lastIdx + 1) : tokens[0];

    String fullyQClsName = tokens[0].replace(".", "/");

    return "<a href=\"" + path.toString() + fullyQClsName + ".html" +
        (tokens.length > 1 ? ("#" + tokens[1].replace("[]", "...")) : "") +
        "\"><code>" + simpleClsName + (tokens.length > 1 ? ("." + tokens[1]) : "") + "</code></a>";
}
 
Example 8
Source File: IgniteLinkTaglet.java    From ignite with Apache License 2.0 3 votes vote down vote up
/**
 * Given the <code>Tag</code> representation of this custom tag, return its string representation.
 * <p>
 * Input: org.apache.ignite.grid.spi.indexing.h2.GridH2IndexingSpi#setIndexCustomFunctionClasses(Class[])
 * <p>
 * Output: <a href="../../../../../org/apache/ignite/grid/spi/indexing/h2/GridH2IndexingSpi.html#
 * setIndexCustomFunctionClasses(java.lang.Class...)">
 * <code>GridH2IndexingSpi.setIndexCustomFunctionClasses(java.lang.Class[])</code></a>
 *
 * @param tag <code>Tag</code> representation of this custom tag.
 */
 public String toString(Tag tag) {
    if (tag.text() == null || tag.text().isEmpty())
        return "";

    File f = tag.position().file();

    String curClass = f == null ? "" : f.getAbsolutePath().replace(File.separator, ".");

    String packPref = "src.main.java.";

    int idx = curClass.indexOf(packPref);

    StringBuilder path = new StringBuilder();

    if (idx != -1) {
        curClass = curClass.substring(idx + packPref.length());

        for (int i = 0, n = curClass.split("\\.").length - 2; i < n; i++)
            path.append("../");
    }

    String[] tokens = tag.text().split("#");

    int lastIdx = tokens[0].lastIndexOf('.');

    String simpleClsName = lastIdx != -1 && lastIdx + 1 < tokens[0].length() ?
        tokens[0].substring(lastIdx + 1) : tokens[0];

    String fullyQClsName = tokens[0].replace(".", "/");

    return "<a href=\"" + path.toString() + fullyQClsName + ".html" +
        (tokens.length > 1 ? ("#" + tokens[1].replace("[]", "...")) : "") +
        "\"><code>" + simpleClsName + (tokens.length > 1 ? ("." + tokens[1]) : "") + "</code></a>";
}