类com.sun.javadoc.ProgramElementDoc源码实例Demo

下面列出了怎么用com.sun.javadoc.ProgramElementDoc的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: sarl   文件: DefaultApidocExcluder.java
@Override
public boolean isExcluded(Doc doc) {
	if (Utils.isHiddenMember(doc.name())) {
		return true;
	}
	if (doc.tags(EXCLUDE_FROM_JAVADOC_TAG).length > 0) {
		return true;
	}
	if (doc instanceof ProgramElementDoc) {
		final ProgramElementDoc element = (ProgramElementDoc) doc;
		if (element.containingPackage().tags(EXCLUDE_FROM_JAVADOC_TAG).length > 0) {
			return true;
		}
		if (Utils.findFirst(element.annotations(), it ->
			Utils.qualifiedNameEquals(
					Utils.getKeywords().getSyntheticMemberAnnotationName(),
					it.annotationType().qualifiedName())) != null) {
			return true;
		}
	}
	// nothing above found a reason to exclude
	return false;
}
 
源代码2 项目: joinery   文件: DocTestSuite.java
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;
}
 
源代码3 项目: pom-manipulation-ext   文件: RootDocProcessor.java
private static boolean exclude( Doc doc )
{
    AnnotationDesc[] annotations = null;
    if ( doc instanceof ProgramElementDoc )
    {
        annotations = ( (ProgramElementDoc) doc ).annotations();
    }
    else if ( doc instanceof PackageDoc )
    {
        annotations = ( (PackageDoc) doc ).annotations();
    }
    if ( annotations != null )
    {
        for ( AnnotationDesc annotation : annotations )
        {
            String qualifiedTypeName = annotation.annotationType().qualifiedTypeName();
            if ( qualifiedTypeName.equals( JavadocExclude.class.getCanonicalName() ) )
            {
                return true;
            }
        }
    }
    // nothing above found a reason to exclude
    return false;
}
 
源代码4 项目: Tehreer-Android   文件: ExcludeDoclet.java
private static boolean exclude(Doc doc) {
    if (doc.tags(TAG_HIDE).length > 0) {
        return true;
    }
    if (doc instanceof ProgramElementDoc) {
        if (((ProgramElementDoc) doc).containingPackage().tags(TAG_HIDE).length > 0) {
            return true;
        }
    }

    return false;
}
 
源代码5 项目: sarl   文件: DefaultApidocExcluder.java
@Override
public boolean isTranslatableToTag(Doc doc) {
	if (doc instanceof ProgramElementDoc) {
		final ProgramElementDoc element = (ProgramElementDoc) doc;
		if (Utils.findFirst(element.annotations(), it ->
			Utils.qualifiedNameEquals(
					Utils.getKeywords().getSyntheticMemberAnnotationName(),
					it.annotationType().qualifiedName())) != null) {
			return true;
		}
	}
	return false;
}
 
源代码6 项目: sarl   文件: Utils.java
/** Find the first element into the given array.
 *
 * @param <T> the type of the elements to filter.
 * @param original the original array.
 * @param ignoreHidden indicates if the hidden elements should be ignored.
 * @param filter the filtering action.
 * @return the first element.
 */
public static <T extends ProgramElementDoc> T findFirst(T[] original, boolean ignoreHidden, Predicate<T> filter) {
	for (final T element : original) {
		if (!ignoreHidden || !isHiddenMember(element.name())) {
			if (filter.test(element)) {
				return element;
			}
		}
	}
	return null;
}
 
源代码7 项目: sarl   文件: Utils.java
/** Replies the SARL element type of the given type.
 *
 * @param type the type.
 * @return the SARL element type, or {@code null} if unknown.
 */
public static Integer getSarlClassification(ProgramElementDoc type) {
	final AnnotationDesc annotation = Utils.findFirst(type.annotations(), it ->
			qualifiedNameEquals(it.annotationType().qualifiedTypeName(), getKeywords().getSarlElementTypeAnnotationName()));
	if (annotation != null) {
		final ElementValuePair[] pairs = annotation.elementValues();
		if (pairs != null && pairs.length > 0) {
			return ((Number) pairs[0].value().value()).intValue();
		}
	}
	return null;
}
 
源代码8 项目: xml-doclet   文件: Parser.java
/**
 * 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 "";
}