Search in sources :

Example 1 with Tag

use of com.sun.javadoc.Tag in project jersey by jersey.

the class ResourceDoclet method addRequestRepresentationDoc.

private static void addRequestRepresentationDoc(final MethodDoc methodDoc, final MethodDocType methodDocType) {
    final Tag requestElement = getSingleTagOrNull(methodDoc, "request.representation.qname");
    final Tag requestExample = getSingleTagOrNull(methodDoc, "request.representation.example");
    if (requestElement != null || requestExample != null) {
        final RequestDocType requestDoc = new RequestDocType();
        final RepresentationDocType representationDoc = new RepresentationDocType();
        /* requestElement exists
             */
        if (requestElement != null) {
            representationDoc.setElement(QName.valueOf(requestElement.text()));
        }
        /* requestExample exists
             */
        if (requestExample != null) {
            final String example = getSerializedExample(requestExample);
            if (!isEmpty(example)) {
                representationDoc.setExample(example);
            } else {
                LOG.warning("Could not get serialized example for method " + methodDoc.qualifiedName());
            }
        }
        requestDoc.setRepresentationDoc(representationDoc);
        methodDocType.setRequestDoc(requestDoc);
    }
}
Also used : Tag(com.sun.javadoc.Tag) ParamTag(com.sun.javadoc.ParamTag) SeeTag(com.sun.javadoc.SeeTag) RequestDocType(org.glassfish.jersey.server.wadl.internal.generators.resourcedoc.model.RequestDocType) RepresentationDocType(org.glassfish.jersey.server.wadl.internal.generators.resourcedoc.model.RepresentationDocType)

Example 2 with Tag

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

the class PropParserTest method whenParseValidTags_thenSuccessful.

@Test
public void whenParseValidTags_thenSuccessful() {
    PropParser propParser = new PropParser();
    Tag[] validTags = new Tag[] { tag("prop1; Type1, Type2, Type3; one-way, two-way"), tag("prop2; Type1; two-way"), tag("prop2; Type1; two-way; one-way; one-shot") };
    for (Tag tag : validTags) {
        propParser.parse(tag);
    }
}
Also used : Tag(com.sun.javadoc.Tag) Test(org.junit.Test)

Example 3 with Tag

use of com.sun.javadoc.Tag in project Orchid by JavaEden.

the class CommentParser method getCommentObject.

public JSONObject getCommentObject(Doc doc) {
    JSONObject comment = new JSONObject();
    String firstSentence = "";
    for (Tag tag : doc.firstSentenceTags()) {
        firstSentence += tag.text();
    }
    if (!EdenUtils.isEmpty(firstSentence)) {
        comment.put("shortDescription", firstSentence);
    }
    if (!EdenUtils.isEmpty(doc.commentText())) {
        String content = doc.commentText();
        if (context.query("options.commentExt") != null) {
            content = context.getTheme().compile(context.query("options.commentExt").toString(), content);
        }
        comment.put("description", content);
    }
    comment.put("inlineTags", getInlineTags(doc));
    comment.put("blockTags", getBlockTags(doc));
    return (comment.length() > 0) ? comment : null;
}
Also used : JSONObject(org.json.JSONObject) Tag(com.sun.javadoc.Tag)

Example 4 with Tag

use of com.sun.javadoc.Tag in project checker-framework by typetools.

the class ManualTaglet method toString.

@Override
public String toString(Tag[] tags) {
    if (tags.length == 0) {
        return "";
    }
    StringBuilder sb = new StringBuilder();
    for (Tag t : tags) {
        String[] split = t.text().split(" ", 2);
        if (t != tags[0]) {
            sb.append(", ");
        }
        sb.append(formatLink(split));
    }
    return formatHeader(sb.toString());
}
Also used : Tag(com.sun.javadoc.Tag)

Example 5 with Tag

use of com.sun.javadoc.Tag in project abstools by abstools.

the class SequenceTaglet method getTagletOutput.

/**
 * @see com.sun.tools.doclets.internal.toolkit.taglets.Taglet#getTagletOutput(com.sun.javadoc.Doc,
 *      com.sun.tools.doclets.internal.toolkit.taglets.TagletWriter)
 */
public TagletOutput getTagletOutput(Doc holder, TagletWriter writer) throws IllegalArgumentException {
    if (diagramDirectory == null) {
        setDestinationDirectory(writer.configuration().destDirName);
    }
    TagletOutput out = writer.getTagletOutputInstance();
    Tag[] tags = holder.tags(getName());
    if (tags.length == 0) {
        return null;
    }
    out.setOutput(toString(tags, writer));
    return out;
}
Also used : Tag(com.sun.javadoc.Tag) TagletOutput(com.sun.tools.doclets.internal.toolkit.taglets.TagletOutput)

Aggregations

Tag (com.sun.javadoc.Tag)40 ParamTag (com.sun.javadoc.ParamTag)14 SeeTag (com.sun.javadoc.SeeTag)12 ArrayList (java.util.ArrayList)7 List (java.util.List)6 Matcher (java.util.regex.Matcher)4 Test (org.junit.Test)4 ClassDoc (com.sun.javadoc.ClassDoc)3 MethodDoc (com.sun.javadoc.MethodDoc)3 TagletOutputImpl (com.sun.tools.doclets.formats.html.TagletOutputImpl)3 HashMap (java.util.HashMap)3 Parameter (com.sun.javadoc.Parameter)2 ThrowsTag (com.sun.javadoc.ThrowsTag)2 Type (com.sun.javadoc.Type)2 TagletWriterImpl (com.sun.tools.doclets.formats.html.TagletWriterImpl)2 RepresentationDocType (org.glassfish.jersey.server.wadl.internal.generators.resourcedoc.model.RepresentationDocType)2 JSONObject (org.json.JSONObject)2 JavadocInlineTagHandler (com.eden.orchid.javadoc.api.JavadocInlineTagHandler)1 ApiField (com.emc.apidocs.model.ApiField)1 PsiDocTag (com.intellij.psi.javadoc.PsiDocTag)1