本文整理汇总了Java中com.sun.javadoc.ProgramElementDoc.isProtected方法的典型用法代码示例。如果您正苦于以下问题:Java ProgramElementDoc.isProtected方法的具体用法?Java ProgramElementDoc.isProtected怎么用?Java ProgramElementDoc.isProtected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.javadoc.ProgramElementDoc
的用法示例。
在下文中一共展示了ProgramElementDoc.isProtected方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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");
}
示例2: 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('+');
}
示例3: 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;
}
示例4: 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 "";
}