Package com.sun.javadoc

Examples of com.sun.javadoc.Tag


    }

    private static String getFirstSentence(Tag[] tags) {
        String firstSentence = null;
        if (tags.length > 0) {
            Tag first = tags[0];
            firstSentence = first.text();
        }
        return firstSentence;
    }
View Full Code Here


    }
  }

  private void processTags(Tag[] tags) {
    for (int i = 0; i < tags.length; i++) {
      Tag tag = tags[i];
      String tagKind = tag.kind();
      if (tagKind.equals("Text")) {
        text(tag.text());
      } else if (tagKind.equals("@see")) {
        processSeeTag((SeeTag) tag);
      } else if (tagKind.equals("@param")) {
        ParamTag paramTag = (ParamTag) tag;
        beginln("param");
        begin("name");
        text(paramTag.parameterName());
        end();
        begin("description");
        processTags(paramTag.inlineTags());
        end();
        endln();
      } else if (tagKind.equals("@example")) {
        ExtraClassResolver extraClassResolver = getExtraClassResolver(tag);
        SourcePosition pos = LinkResolver.resolveLink(tag, extraClassResolver);
        String source = slurpSource(pos);
        begin("pre", "class", "code");
        beginCDATA();
        text(source);
        endCDATA();
        endln();
      } else if (tagKind.equals("@gwt.include")) {
        String contents = ResourceIncluder.getResourceFromClasspathScrubbedForHTML(tag);
        begin("pre", "class", "code");
        text(contents);
        endln();
      } else if (!standardTagKinds.contains(tag.name())) {
        // Custom tag; pass it along other tag.
        //
        String tagName = tag.name().substring(1);
        begin(tagName);
        processTags(tag.inlineTags());
        end();
      }
    }
  }
View Full Code Here

            return null;

        // This should only be invoked with 0 or 1 tags. I suppose someone could put @tapestrydoc in the comment block
        // more than once.

        Tag tag = tags[0];

        try
        {
            StringWriter writer = new StringWriter(5000);

            ClassDoc classDoc = (ClassDoc) tag.holder();

            if (firstSeen == null)
                firstSeen = classDoc;

            ClassDescription cd = getDescription(classDoc.qualifiedName());
View Full Code Here

            return null;

        // This should only be invoked with 0 or 1 tags. I suppose someone could put @tapestrydoc in the comment block
        // more than once.

        Tag tag = tags[0];

        try
        {
            StringWriter writer = new StringWriter(5000);

            ClassDoc classDoc = (ClassDoc) tag.holder();

            if (firstSeen == null)
                firstSeen = classDoc;

            ClassDescription cd = getDescription(classDoc.qualifiedName());
View Full Code Here

    do {
      found = inlineTagMatcher.find();
      int end = found ? inlineTagMatcher.start() : text.length();
      if (end>start) {
        // add plain text tag:
        Tag tag = new TagImpl(holder,text.substring(start,end));
        tags.add(tag);
        start = end;
      }
      if (found) {
        // add inline tag:
        Tag tag = createTag(holder,text.substring(inlineTagMatcher.start()+1,inlineTagMatcher.end()-1));
        tags.add(tag);
        start = inlineTagMatcher.end();
      }
    } while (found);
    return (Tag[])tags.toArray(new Tag[tags.size()]);
View Full Code Here

    boolean found;
    int start = 0;
    do {
      found = tagMatcher.find();
      int end = found ? tagMatcher.start() : text.length();
      Tag tag = createTag(holder,text.substring(start,end));
      tags.add(tag);
      start = end;
    } while (found);
    return (Tag[])tags.toArray(new Tag[tags.size()]);
  }
View Full Code Here

      if (text.length()>0) {
        allTags = Util.extractTags(this,text);
        firstSentenceTags = Util.extractInlineTags(this,Util.firstSentence(text));
        Map/*String->List<Tag>*/ tagsByName = new HashMap();
        for (int i = 0; i < allTags.length; i++) {
          Tag tag = allTags[i];
          List tags = (List)tagsByName.get(tag.name());
          if (tags==null) {
            tags = new ArrayList();
            tagsByName.put(tag.name(),tags);
          }
          tags.add(tag);
        }
        for (Iterator iterator = tagsByName.entrySet().iterator(); iterator.hasNext();) {
          Map.Entry entry = (Map.Entry)iterator.next();
View Full Code Here

     * @return the string of tags, each separated by a carriage return
     */
    public static String getTagsString(List tags) {
        StringBuffer buffer = new StringBuffer();
        Iterator i;
        Tag tag;

        for (i = tags.iterator();
             i.hasNext();
             ) {
            tag = (Tag) i.next();

            buffer.append(tag.name()).append(' ').append(tag.text());

            if (i.hasNext()) {
                buffer.append('\n');
            }
        }
View Full Code Here

            return "";
        }
        final StringBuilder buffer = new StringBuilder(128);
        buffer.append("\n<p><font size=\"-1\">");
        for (int i=0; i<tags.length; i++) {
            final Tag tag = tags[i];
            File file = tag.position().file();
            module = file.getName();
            while (file != null) {
                file = file.getParentFile();
                if (file.getName().equals("src")) {
                    file = file.getParentFile();
View Full Code Here

            return null;

        // This should only be invoked with 0 or 1 tags. I suppose someone could put @tapestrydoc in the comment block
        // more than once.

        Tag tag = tags[0];

        try
        {
            StringWriter writer = new StringWriter(5000);

            ClassDoc classDoc = (ClassDoc) tag.holder();

            if (firstSeen == null)
                firstSeen = classDoc;

            ClassDescription cd = getDescription(classDoc.qualifiedName());
View Full Code Here

TOP

Related Classes of com.sun.javadoc.Tag

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.