com.sun.javadoc.Doc.name()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(182)

本文整理了Java中com.sun.javadoc.Doc.name()方法的一些代码示例,展示了Doc.name()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Doc.name()方法的具体详情如下:
包路径:com.sun.javadoc.Doc
类名称:Doc
方法名:name

Doc.name介绍

[英]Returns the non-qualified name of this Doc item.
[中]返回此单据项的非限定名称。

代码示例

代码示例来源:origin: de.unkrig/de-unkrig-commons

  1. @Override public int
  2. compare(@Nullable Doc d1, @Nullable Doc d2) {
  3. if (d1 == null) return d2 == null ? 0 : 1;
  4. if (d2 == null) return -1;
  5. return d1.name().compareToIgnoreCase(d2.name());
  6. }
  7. };

代码示例来源:origin: de.unkrig.commons/commons-doclet

  1. @Override public int
  2. compare(@Nullable Doc d1, @Nullable Doc d2) {
  3. if (d1 == null) return d2 == null ? 0 : 1;
  4. if (d2 == null) return -1;
  5. return d1.name().compareToIgnoreCase(d2.name());
  6. }
  7. };

代码示例来源:origin: org.jboss.apiviz/apiviz

  1. private String getTargetName() {
  2. if (target instanceof ClassDoc) {
  3. return ((ClassDoc) target).qualifiedName();
  4. } else {
  5. return target.name();
  6. }
  7. }

代码示例来源:origin: org.jboss.apiviz/apiviz

  1. private static String getNodeId(Doc node) {
  2. String name;
  3. if (node instanceof ClassDoc) {
  4. name = ((ClassDoc) node).qualifiedName();
  5. } else {
  6. name = node.name();
  7. }
  8. return name.replace('.', '_');
  9. }

代码示例来源:origin: org.jboss.apiviz/apiviz

  1. private String getSourceName() {
  2. if (source instanceof ClassDoc) {
  3. return ((ClassDoc) source).qualifiedName();
  4. } else {
  5. return source.name();
  6. }
  7. }

代码示例来源:origin: konsoletyper/teavm-javac

  1. public int compare(Doc d1, Doc d2) {
  2. String doc1 = d1.name();
  3. String doc2 = d2.name();
  4. int compareResult;
  5. if ((compareResult = doc1.compareToIgnoreCase(doc2)) != 0) {
  6. return compareResult;
  7. } else if (d1 instanceof ProgramElementDoc && d2 instanceof ProgramElementDoc) {
  8. doc1 = (((ProgramElementDoc) d1).qualifiedName());
  9. doc2 = (((ProgramElementDoc) d2).qualifiedName());
  10. return doc1.compareToIgnoreCase(doc2);
  11. } else {
  12. return 0;
  13. }
  14. }
  15. }

代码示例来源:origin: uk.org.retep.doclet/core

  1. public int compare(Doc d1, Doc d2) {
  2. String doc1 = d1.name();
  3. String doc2 = d2.name();
  4. int compareResult;
  5. if ((compareResult = doc1.compareToIgnoreCase(doc2)) != 0) {
  6. return compareResult;
  7. } else if (d1 instanceof ProgramElementDoc && d2 instanceof ProgramElementDoc) {
  8. doc1 = (((ProgramElementDoc) d1).qualifiedName());
  9. doc2 = (((ProgramElementDoc) d2).qualifiedName());
  10. return doc1.compareToIgnoreCase(doc2);
  11. } else {
  12. return 0;
  13. }
  14. }
  15. }

代码示例来源:origin: konsoletyper/teavm-javac

  1. /**
  2. * Adjust list of members according to their names. Check the first
  3. * character in a member name, and then add the member to a list of members
  4. * for that particular unicode character.
  5. *
  6. * @param elements Array of members.
  7. */
  8. protected void adjustIndexMap(Doc[] elements) {
  9. for (int i = 0; i < elements.length; i++) {
  10. if (shouldAddToIndexMap(elements[i])) {
  11. String name = elements[i].name();
  12. char ch = (name.length()==0)?
  13. '*' :
  14. Character.toUpperCase(name.charAt(0));
  15. Character unicode = new Character(ch);
  16. List<Doc> list = indexmap.get(unicode);
  17. if (list == null) {
  18. list = new ArrayList<Doc>();
  19. indexmap.put(unicode, list);
  20. }
  21. list.add(elements[i]);
  22. }
  23. }
  24. }

代码示例来源:origin: uk.org.retep.doclet/core

  1. /**
  2. * Adjust list of members according to their names. Check the first
  3. * character in a member name, and then add the member to a list of members
  4. * for that particular unicode character.
  5. *
  6. * @param elements Array of members.
  7. */
  8. protected void adjustIndexMap(Doc[] elements) {
  9. for (int i = 0; i < elements.length; i++) {
  10. if (shouldAddToIndexMap(elements[i])) {
  11. String name = elements[i].name();
  12. char ch = (name.length()==0)?
  13. '*' :
  14. Character.toUpperCase(name.charAt(0));
  15. Character unicode = new Character(ch);
  16. List<Doc> list = indexmap.get(unicode);
  17. if (list == null) {
  18. list = new ArrayList<Doc>();
  19. indexmap.put(unicode, list);
  20. }
  21. list.add(elements[i]);
  22. }
  23. }
  24. }

代码示例来源:origin: de.smartics.util/project-analysis-javadoc

  1. log.debug("Adding information '" + filteredDoc.name() + "'.");

代码示例来源:origin: de.unkrig/de-unkrig-commons

  1. /**
  2. * Generates the "fragment" identifier for the given <var>doc</var>.
  3. * <dl>
  4. * <dt>{@link FieldDoc}:</dt>
  5. * <dd>{@code "#fieldName"}</dd>
  6. * <dt>{@link MethodDoc}:</dt>
  7. * <dd>{@code "#methodName(java.lang.String,int)"}</dd>
  8. * <dt>Other:</dt>
  9. * <dd>{@code ""}</dd>
  10. * </dl>
  11. */
  12. private static String
  13. fragmentIdentifier(Doc doc) {
  14. if (doc.isField()) return '#' + doc.name();
  15. if (doc.isConstructor()) {
  16. ConstructorDoc constructorDoc = (ConstructorDoc) doc;
  17. return (
  18. '#'
  19. + constructorDoc.containingClass().name()
  20. + Html.parameterListForFragmentIdentifier(constructorDoc)
  21. );
  22. }
  23. if (doc.isMethod()) {
  24. MethodDoc methodDoc = (MethodDoc) doc;
  25. return '#' + doc.name() + Html.parameterListForFragmentIdentifier(methodDoc);
  26. }
  27. return "";
  28. }

代码示例来源:origin: de.unkrig.commons/commons-doclet

  1. /**
  2. * Generates the "fragment" identifier for the given <var>doc</var>.
  3. * <dl>
  4. * <dt>{@link FieldDoc}:</dt>
  5. * <dd>{@code "#fieldName"}</dd>
  6. * <dt>{@link MethodDoc}:</dt>
  7. * <dd>{@code "#methodName(java.lang.String,int)"}</dd>
  8. * <dt>Other:</dt>
  9. * <dd>{@code ""}</dd>
  10. * </dl>
  11. */
  12. private static String
  13. fragmentIdentifier(Doc doc) {
  14. if (doc.isField()) return '#' + doc.name();
  15. if (doc.isConstructor()) {
  16. ConstructorDoc constructorDoc = (ConstructorDoc) doc;
  17. return (
  18. '#'
  19. + constructorDoc.containingClass().name()
  20. + Html.parameterListForFragmentIdentifier(constructorDoc)
  21. );
  22. }
  23. if (doc.isMethod()) {
  24. MethodDoc methodDoc = (MethodDoc) doc;
  25. return '#' + doc.name() + Html.parameterListForFragmentIdentifier(methodDoc);
  26. }
  27. return "";
  28. }

代码示例来源:origin: de.unkrig/de-unkrig-commons

  1. defaultLabelHtml = to.name();
  2. } else {
  3. defaultLabelHtml += to.name();
  4. } else
  5. if (to.isConstructor()) {
  6. if (to.isMethod()) {
  7. MethodDoc toMethodDoc = (MethodDoc) to;
  8. defaultLabelHtml += to.name() + this.prettyPrintParameterList(toMethodDoc);
  9. } else

代码示例来源:origin: de.unkrig.commons/commons-doclet

  1. defaultLabelHtml = to.name();
  2. } else {
  3. defaultLabelHtml += to.name();
  4. } else
  5. if (to.isConstructor()) {
  6. if (to.isMethod()) {
  7. MethodDoc toMethodDoc = (MethodDoc) to;
  8. defaultLabelHtml += to.name() + this.prettyPrintParameterList(toMethodDoc);
  9. } else

相关文章