本文整理汇总了Java中org.apache.bcel.classfile.FieldOrMethod.isPrivate方法的典型用法代码示例。如果您正苦于以下问题:Java FieldOrMethod.isPrivate方法的具体用法?Java FieldOrMethod.isPrivate怎么用?Java FieldOrMethod.isPrivate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.bcel.classfile.FieldOrMethod
的用法示例。
在下文中一共展示了FieldOrMethod.isPrivate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: equalScope
import org.apache.bcel.classfile.FieldOrMethod; //导入方法依赖的package包/类
/**
* Tests whether the scope of a field or method is compatible
* with the scope of this check. References for compatible
* fields or methods should be checked.
* @param aFieldOrMethod the field or method to check.
* @return true if the scope of aFieldOrMethod is compatible
* with the scope of this check.
*/
private boolean equalScope(FieldOrMethod aFieldOrMethod)
{
if (aFieldOrMethod.isPrivate()) {
return (mScope == Scope.PRIVATE);
}
else if (aFieldOrMethod.isProtected()) {
return (mScope == Scope.PROTECTED);
}
else if (aFieldOrMethod.isPublic()) {
return (mScope == Scope.PUBLIC);
}
else {
return (mScope == Scope.PACKAGE);
}
}
示例2: inScope
import org.apache.bcel.classfile.FieldOrMethod; //导入方法依赖的package包/类
/**
* Determines whether the declared scope of a field or method is in
* a set of scopes.
* @param aFieldOrMethod the field or method to test.
* @param aScopes the set of scopes to test against.
* @return true if the declared scope of aFieldOrMethod is in aScopes.
*/
public static boolean inScope(FieldOrMethod aFieldOrMethod, Set aScopes)
{
if (aFieldOrMethod.isPrivate()) {
return (aScopes.contains(Scope.PRIVATE));
}
else if (aFieldOrMethod.isProtected()) {
return (aScopes.contains(Scope.PROTECTED));
}
else if (aFieldOrMethod.isPublic()) {
return (aScopes.contains(Scope.PUBLIC));
}
else {
return (aScopes.contains(Scope.PACKAGE));
}
}
示例3: BcelAccessible
import org.apache.bcel.classfile.FieldOrMethod; //导入方法依赖的package包/类
public BcelAccessible(FieldOrMethod accessible) {
if (accessible.isPrivate()) {
flag = AccessFlag.PRIVATE;
}
else if (accessible.isProtected()) {
flag = AccessFlag.PROTECTED;
}
else if (accessible.isPublic()) {
flag = AccessFlag.PUBLIC;
}
else {
flag = AccessFlag.PACKAGE;
}
}