Search in sources :

Example 1 with SeeTag

use of com.sun.javadoc.SeeTag in project RoboBinding by RoboBinding.

the class InlineLinkTagTranslator method translate.

public String translate(String text, Tag containingTag, Doc doc, TagletWriterImpl tagletWriterImpl) {
    StrBuilder sb = new StrBuilder(text);
    List<SeeTag> inlineLinkTags = getInlineLinkTags(containingTag);
    for (SeeTag inlineLinkTag : inlineLinkTags) {
        String inlineLinkContent = "{@link " + inlineLinkTag.text() + "}";
        if (sb.contains(inlineLinkContent)) {
            TagletOutput tagletOutput = tagletWriterImpl.seeTagOutput(doc, new SeeTag[] { inlineLinkTag });
            String seeAlsoText = tagletOutput.toString();
            sb.replaceAll(inlineLinkContent, seeAlsoText.split("</span></dt><dd>")[1]);
        }
    }
    return sb.toString();
}
Also used : SeeTag(com.sun.javadoc.SeeTag) StrBuilder(org.apache.commons.lang3.text.StrBuilder) TagletOutput(com.sun.tools.doclets.internal.toolkit.taglets.TagletOutput)

Example 2 with SeeTag

use of com.sun.javadoc.SeeTag in project markdown-doclet by Abnaxos.

the class DocCommentProcessor method renderSeeTag.

private void renderSeeTag(MarkdownDoclet doclet, StringBuilder tagBlock, PsiDocTag docTag) {
    final String seeText = toString(docTag, false);
    if (seeText.startsWith("\"")) {
        SeeTag tag = new SeeTag() {

            @Override
            public String label() {
                return null;
            }

            @Override
            public PackageDoc referencedPackage() {
                return null;
            }

            @Override
            public String referencedClassName() {
                return null;
            }

            @Override
            public ClassDoc referencedClass() {
                return null;
            }

            @Override
            public String referencedMemberName() {
                return null;
            }

            @Override
            public MemberDoc referencedMember() {
                return null;
            }

            @Override
            public String name() {
                return "@see";
            }

            @Override
            public Doc holder() {
                return null;
            }

            @Override
            public String kind() {
                return "@see";
            }

            @Override
            public String text() {
                return seeText;
            }

            @Override
            public Tag[] inlineTags() {
                return new Tag[0];
            }

            @Override
            public Tag[] firstSentenceTags() {
                return new Tag[0];
            }

            @Override
            public SourcePosition position() {
                return null;
            }
        };
        SeeTagRenderer.INSTANCE.render(tag, tagBlock, doclet);
    } else {
        tagBlock.append("\n@").append(docTag.getName());
        tagBlock.append(' ').append(seeText);
    }
}
Also used : SeeTag(com.sun.javadoc.SeeTag) Tag(com.sun.javadoc.Tag) SeeTag(com.sun.javadoc.SeeTag) PsiDocTag(com.intellij.psi.javadoc.PsiDocTag) PsiInlineDocTag(com.intellij.psi.javadoc.PsiInlineDocTag)

Example 3 with SeeTag

use of com.sun.javadoc.SeeTag in project com.revolsys.open by revolsys.

the class DocletUtil method description.

public static void description(final XmlWriter writer, final ClassDoc containingClass, final Tag[] tags) {
    if (tags != null && tags.length > 0) {
        for (final Tag tag : tags) {
            final String kind = tag.kind();
            if (tag instanceof SeeTag) {
                final SeeTag seeTag = (SeeTag) tag;
                seeTag(writer, containingClass, seeTag);
            } else if ("Text".equals(kind)) {
                writer.write(tag.text());
            }
        }
    }
}
Also used : SeeTag(com.sun.javadoc.SeeTag) Tag(com.sun.javadoc.Tag) ParamTag(com.sun.javadoc.ParamTag) SeeTag(com.sun.javadoc.SeeTag)

Example 4 with SeeTag

use of com.sun.javadoc.SeeTag in project wso2-axis2-transports by wso2.

the class ResourceInfoDoclet method getFirstSentence.

private static String getFirstSentence(Doc doc) {
    Tag[] tags = doc.firstSentenceTags();
    if (tags.length == 0) {
        return null;
    }
    StringBuilder buffer = new StringBuilder();
    for (Tag tag : tags) {
        if (tag instanceof SeeTag) {
            buffer.append("{");
            buffer.append(tag.name());
            buffer.append(" ");
            buffer.append(((SeeTag) tag).referencedClassName());
            buffer.append("}");
        } else {
            buffer.append(tag.text());
        }
    }
    return buffer.toString();
}
Also used : SeeTag(com.sun.javadoc.SeeTag) SeeTag(com.sun.javadoc.SeeTag) Tag(com.sun.javadoc.Tag) ParamTag(com.sun.javadoc.ParamTag)

Example 5 with SeeTag

use of com.sun.javadoc.SeeTag in project RoboBinding by RoboBinding.

the class InlineLinkTagTranslator method getInlineLinkTags.

private List<SeeTag> getInlineLinkTags(Tag containingTag) {
    List<SeeTag> linkTags = new ArrayList<SeeTag>();
    Tag[] inlineTags = containingTag.inlineTags();
    for (Tag tag : inlineTags) {
        if ("@link".equals(tag.name())) {
            linkTags.add((SeeTag) tag);
        }
    }
    return linkTags;
}
Also used : SeeTag(com.sun.javadoc.SeeTag) ArrayList(java.util.ArrayList) SeeTag(com.sun.javadoc.SeeTag) Tag(com.sun.javadoc.Tag)

Aggregations

SeeTag (com.sun.javadoc.SeeTag)6 Tag (com.sun.javadoc.Tag)5 ParamTag (com.sun.javadoc.ParamTag)3 PsiDocTag (com.intellij.psi.javadoc.PsiDocTag)1 PsiInlineDocTag (com.intellij.psi.javadoc.PsiInlineDocTag)1 TagletOutput (com.sun.tools.doclets.internal.toolkit.taglets.TagletOutput)1 ArrayList (java.util.ArrayList)1 StrBuilder (org.apache.commons.lang3.text.StrBuilder)1