当前位置: 首页>>代码示例>>Java>>正文


Java ProgramElementDoc类代码示例

本文整理汇总了Java中com.sun.javadoc.ProgramElementDoc的典型用法代码示例。如果您正苦于以下问题:Java ProgramElementDoc类的具体用法?Java ProgramElementDoc怎么用?Java ProgramElementDoc使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ProgramElementDoc类属于com.sun.javadoc包,在下文中一共展示了ProgramElementDoc类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: exclude

import com.sun.javadoc.ProgramElementDoc; //导入依赖的package包/类
private static boolean exclude(Doc doc) {
    // if (doc.name().contains("UnitTest")) {
    // return true;
    // }
    if (doc != null) {
        if (doc.tags(EXCLUDE_TAG).length > 0) {
            return true;
        } else if (doc instanceof ProgramElementDoc) {
            if (exclude(((ProgramElementDoc) doc).containingPackage())) {
                return true;
            } else if (exclude(((ProgramElementDoc) doc).containingClass())) {
                return true;
            }
        }
    }
    // nothing above found a reason to exclude
    return false;
}
 
开发者ID:SUPENTA,项目名称:flitchio-sdk,代码行数:19,代码来源:JavadocFilter.java

示例2: linkedName

import com.sun.javadoc.ProgramElementDoc; //导入依赖的package包/类
/**
 * Appends to the current document a link that is
 * built from the given ``element``. Such links is
 * usually leading to the internal corresponding
 * document section
 * 
 * @param element Element to build link from.
 */
public void linkedName(final ProgramElementDoc element) {
	final StringBuffer anchorBuilder = new StringBuffer()
		.append('#')
		.append(element.name());
	if (element instanceof ExecutableMemberDoc) {
		final ExecutableMemberDoc member = (ExecutableMemberDoc) element;
		final Parameter[] parameters = member.parameters();
		if (parameters.length == 0) { // Empty constructor case.
			
		}
		for (int i = 0; i < parameters.length; i++) {
			anchorBuilder.append(parameters[i].type().simpleTypeName());
			if (i < parameters.length - 1) {
				anchorBuilder.append('-');
			}
		}
	}
	final String url = anchorBuilder.toString().toLowerCase();
	link(element.name(), url);
}
 
开发者ID:Faylixe,项目名称:marklet,代码行数:29,代码来源:MarkletDocumentBuilder.java

示例3: start

import com.sun.javadoc.ProgramElementDoc; //导入依赖的package包/类
public static boolean start(final RootDoc root) {
    for (final ClassDoc cls : root.classes()) {
        final List<ProgramElementDoc> elements = new LinkedList<>();
        elements.add(cls);
        elements.addAll(Arrays.asList(cls.constructors()));
        elements.addAll(Arrays.asList(cls.methods()));
        for (final ProgramElementDoc elem : elements) {
            for (final Tag tag : elem.inlineTags()) {
                final String name = tag.name();
                if (name.equals("@code") && tag.text().trim().startsWith(">")) {
                    generateRunner(cls, elem, tag);
                }
            }
        }
    }
    return true;
}
 
开发者ID:cardillo,项目名称:joinery,代码行数:18,代码来源:DocTestSuite.java

示例4: formatModifiers

import com.sun.javadoc.ProgramElementDoc; //导入依赖的package包/类
public String formatModifiers(ProgramElementDoc doc) {
    StringBuffer sb = new StringBuffer(32);
    if (doc.isPublic()) {
        sb.append("public ");
    }
    if (doc.isPrivate()) {
        sb.append("private ");
    }
    if (doc.isProtected()) {
        sb.append("protected ");
    }
    if (doc.isStatic()) {
        sb.append("static ");
    }
    if (doc.isInterface()) {
        sb.append("interface ");
    }
    if (doc.isFinal()) {
        sb.append("final ");
    }
    if (doc.isClass()) {
        sb.append("class ");
    }
    return (sb.length() == 0) ? "" : color(sb.toString(), "blue");
}
 
开发者ID:slipperyseal,项目名称:atomicobjects,代码行数:26,代码来源:BonsaiDoc.java

示例5: getLink

import com.sun.javadoc.ProgramElementDoc; //导入依赖的package包/类
public String getLink(ProgramElementDoc doc, int context)
{
    ClassDoc cdoc = doc.containingClass();
    if (doc instanceof ClassDoc || doc.isInterface() || doc.isEnum() || doc.isError() || doc.isException() || doc.isAnnotationType())
    {
        cdoc = (ClassDoc) doc;
    }

    LinkInfoImpl lnInfo = new LinkInfoImpl(context, cdoc, "", null);
    if (lnInfo == null)
    {
        return null;
    }
    String link = docWriter.getLink(lnInfo);
    if (link == null)
    {
        return null;
    }
    return getHref(link) + "#" + getSignature(doc);
}
 
开发者ID:tcolar,项目名称:javaontracks,代码行数:21,代码来源:JOTDocletIndexWriter.java

示例6: isProgramElementDocAnnotatedWith

import com.sun.javadoc.ProgramElementDoc; //导入依赖的package包/类
protected boolean isProgramElementDocAnnotatedWith(ProgramElementDoc elementDoc, String annotation) {
	AnnotationDesc[] annotations = elementDoc.annotations();
	for (int i = 0; i < annotations.length; i++) {
		if (annotations[i].annotationType().qualifiedTypeName().equals(annotation)) {
			return true;
		}
	}
	return false;
}
 
开发者ID:WinRoad-NET,项目名称:wrdocletbase,代码行数:10,代码来源:AbstractDocBuilder.java

示例7: commentText

import com.sun.javadoc.ProgramElementDoc; //导入依赖的package包/类
private static String commentText(ProgramElementDoc doc) {
    if (doc instanceof MethodDoc) {
        MethodDoc method = (MethodDoc) doc;

        return Javadocs.commentText(method).orElse("");
    } else return doc.commentText();
}
 
开发者ID:georgewfraser,项目名称:vscode-javac,代码行数:8,代码来源:Hovers.java

示例8: getClassName

import com.sun.javadoc.ProgramElementDoc; //导入依赖的package包/类
/**
 * Reconstitute the class name from the given class JavaDoc object.
 *
 * @param doc the Javadoc model for the given class.
 * @return The (string) class name of the given class.
 */
protected static String getClassName(ProgramElementDoc doc, boolean binaryName) {
    PackageDoc containingPackage = doc.containingPackage();
    String className = doc.name();
    if (binaryName) {
        className = className.replaceAll("\\.", "\\$");
    }
    return containingPackage.name().length() > 0 ?
            String.format("%s.%s", containingPackage.name(), className) :
            String.format("%s", className);
}
 
开发者ID:broadinstitute,项目名称:barclay,代码行数:17,代码来源:DocletUtils.java

示例9: writeAccessibility

import com.sun.javadoc.ProgramElementDoc; //导入依赖的package包/类
static IndentingPrintWriter writeAccessibility(IndentingPrintWriter out, ProgramElementDoc element) {
    if (element.isStatic()) {
        out.append("{static}").whitespace();
    }
    return element.isPrivate() ? out.append('-')
            : element.isProtected() ? out.append('#')
            : element.isPackagePrivate() ? out.append('~')
            : out.append('+');
}
 
开发者ID:talsma-ict,项目名称:umldoclet,代码行数:10,代码来源:FieldRenderer.java

示例10: annotationNamed

import com.sun.javadoc.ProgramElementDoc; //导入依赖的package包/类
static Optional<AnnotationDesc> annotationNamed(
    ProgramElementDoc doc, String annotationName) {
  for (AnnotationDesc a : doc.annotations()) {
    if (annotationName.equals(a.annotationType().qualifiedTypeName())) {
      return Optional.of(a);
    }
  }
  return Optional.absent();
}
 
开发者ID:mikesamuel,项目名称:closure-maven-plugin,代码行数:10,代码来源:PluginConfigDoclet.java

示例11: getVisibility

import com.sun.javadoc.ProgramElementDoc; //导入依赖的package包/类
/**
 * Sets the visibility for the class, method or field.
 *
 * @param member The member for which the visibility needs to be set (class, method, or field).
 * @param node The node to which the visibility should be set.
 */
private static String getVisibility(ProgramElementDoc member) {
  if (member.isPrivate()) return "private";
  if (member.isProtected()) return "protected";
  if (member.isPublic()) return "public";
  if (member.isPackagePrivate()) return "package-private";
  // Should never happen
  return null;
}
 
开发者ID:pageseeder,项目名称:xmldoclet,代码行数:15,代码来源:XMLDoclet.java

示例12: parseScope

import com.sun.javadoc.ProgramElementDoc; //导入依赖的package包/类
/**
 * Returns string representation of scope
 * 
 * @param doc
 * @return
 */
protected String parseScope(ProgramElementDoc doc) {
  if (doc.isPrivate()) {
    return "private";
  } else if (doc.isProtected()) {
    return "protected";
  } else if (doc.isPublic()) {
    return "public";
  }
  return "";
}
 
开发者ID:riptano,项目名称:xml-doclet,代码行数:17,代码来源:Parser.java

示例13: getAnnotationDesc

import com.sun.javadoc.ProgramElementDoc; //导入依赖的package包/类
public static AnnotationDesc getAnnotationDesc(ProgramElementDoc doc, Class<? extends Annotation> annotationClz) {
	for (AnnotationDesc annotationDesc : doc.annotations()) {
		if (annotationDesc.annotationType()
				.qualifiedTypeName().equals(annotationClz.getName())) {
			return annotationDesc;
			}
	}
	return null;
}
 
开发者ID:linkeer8802,项目名称:api-resolver,代码行数:10,代码来源:DocletUtil.java

示例14: returnSignature

import com.sun.javadoc.ProgramElementDoc; //导入依赖的package包/类
/**
 * Appends to the current document the ``member``
 * returns label, which is composed of the given
 * ``member`` modifiers if any, followed by the
 * return type link, if the given ``member`` is
 * a method, 
 * 
 * @param element Member to build return label for.
 */
public void returnSignature(final ProgramElementDoc element) {
	code(element.modifiers());
	if (element.isMethod()) {
		final MethodDoc method = (MethodDoc) element;
		character(' ');
		// TODO : Consider using source instance instead.
		typeLink(method.containingPackage(), method.returnType());
	}
}
 
开发者ID:Faylixe,项目名称:marklet,代码行数:19,代码来源:MarkletDocumentBuilder.java

示例15: rowSignature

import com.sun.javadoc.ProgramElementDoc; //导入依赖的package包/类
/**
 * Appends to the current document the signature
 * of the given ``member`` as a table row.
 * 
 * @param element Member to write signature from.
 */
public void rowSignature(final ProgramElementDoc element) {
	startTableRow();
	returnSignature(element);
	cell();
	linkedName(element);
	if (element instanceof ExecutableMemberDoc) {
		final ExecutableMemberDoc member = (ExecutableMemberDoc) element;
		inlineParameters(member.parameters());
	}
	endTableRow();
	newLine();
}
 
开发者ID:Faylixe,项目名称:marklet,代码行数:19,代码来源:MarkletDocumentBuilder.java


注:本文中的com.sun.javadoc.ProgramElementDoc类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。