com.sun.javadoc.MemberDoc Java Examples

The following examples show how to use com.sun.javadoc.MemberDoc. 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: TodoTagRenderer.java    From markdown-doclet with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Render the tag.
 *
 * @todo TODOs can also be used in member docs ...
 *
 * @param tag       The tag to render.
 * @param target    The target {@link StringBuilder}.
 * @todo ... or even parameter docs -- which is a little strange, actually. ;)
 * @param doclet    The doclet.
 */
@Override
public void render(Tag tag, StringBuilder target, MarkdownDoclet doclet) {
    Counter counter;
    if ( tag.holder() instanceof MemberDoc ) {
        counter = getCounter(((MemberDoc)tag.holder()).containingClass());
    }
    else {
        counter = getCounter(tag.holder());
    }
    target.append("<div class=\"todo\">");
    target.append("<div class=\"todoTitle\"><span class=\"todoTitle\">")
            .append(doclet.getOptions().getTodoTitle())
            .append("</span><span class=\"todoCounter\">#")
            .append(counter.next())
            .append("</span></div>");
    target.append("<div class=\"todoText\">");
    target.append(doclet.toHtml(tag.text().trim()));
    target.append("</div></div>");
}
 
Example #2
Source File: Doclava.java    From doclava with Apache License 2.0 5 votes vote down vote up
/**
 * Returns true if the given element is hidden.
 */
private static boolean isHidden(Doc doc) {
  // Methods, fields, constructors.
  if (doc instanceof MemberDoc) {
    return hasHideAnnotation(doc);
  }

  // Classes, interfaces, enums, annotation types.
  if (doc instanceof ClassDoc) {
    ClassDoc classDoc = (ClassDoc) doc;

    // Check the containing package.
    if (hasHideAnnotation(classDoc.containingPackage())) {
      return true;
    }

    // Check the class doc and containing class docs if this is a
    // nested class.
    ClassDoc current = classDoc;
    do {
      if (hasHideAnnotation(current)) {
        return true;
      }

      current = current.containingClass();
    } while (current != null);
  }

  return false;
}
 
Example #3
Source File: SarlFieldWriter.java    From sarl with Apache License 2.0 4 votes vote down vote up
@Override
protected String modifierString(MemberDoc member) {
	final int ms = member.modifierSpecifier();
	final int no = Modifier.FINAL | Modifier.NATIVE | Modifier.SYNCHRONIZED;
	return Modifier.toString(ms & ~no);
}
 
Example #4
Source File: DocCommentProcessor.java    From markdown-doclet with GNU General Public License v3.0 4 votes vote down vote up
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);
    }
}
 
Example #5
Source File: MarkdownDoclet.java    From markdown-doclet with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Process the member documentation.
 *
 * @param doc    The member documentation.
 */
protected void processMember(MemberDoc doc) {
    defaultProcess(doc, true);
}