本文整理汇总了Java中org.apache.bcel.classfile.FieldOrMethod类的典型用法代码示例。如果您正苦于以下问题:Java FieldOrMethod类的具体用法?Java FieldOrMethod怎么用?Java FieldOrMethod使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FieldOrMethod类属于org.apache.bcel.classfile包,在下文中一共展示了FieldOrMethod类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: ignore
import org.apache.bcel.classfile.FieldOrMethod; //导入依赖的package包/类
/**
* Determines whether a class name, and field or method should be ignored.
* @param aClassName the class name to consider.
* @param aFieldOrMethod the field or method to consider.
* @return true if aClassName, and field or method should be ignored.
*/
protected boolean ignore(String aClassName, FieldOrMethod aFieldOrMethod)
{
final String fieldOrMethodName = aFieldOrMethod.getName();
return (!equalScope(aFieldOrMethod)
|| mIgnoreClassNameRegexp.matcher(aClassName).matches()
|| mIgnoreNameRegexp.matcher(fieldOrMethodName).matches());
}
示例4: 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;
}
}
示例5: getSignature
import org.apache.bcel.classfile.FieldOrMethod; //导入依赖的package包/类
/**
* 获得范型中的类型
*
* @param obj
* @return
*/
public static String getSignature(FieldOrMethod obj) {
for (Attribute attribute : obj.getAttributes()) {
if (attribute instanceof Signature) {
return ((Signature) attribute).getSignature();
}
}
return obj.getSignature();
}
示例6: isSynthetic
import org.apache.bcel.classfile.FieldOrMethod; //导入依赖的package包/类
boolean isSynthetic(FieldOrMethod obj) {
Attribute[] a = obj.getAttributes();
for (Attribute aA : a)
if (aA instanceof Synthetic)
return true;
return false;
}
示例7: isSynthetic
import org.apache.bcel.classfile.FieldOrMethod; //导入依赖的package包/类
/**
* Figure out if a class member (field or method) is synthetic.
*
* @param member
* a field or method
* @return true if the member is synthetic
*/
private boolean isSynthetic(FieldOrMethod member) {
if (member.isSynthetic()) // this never works, but worth a try
return true;
String name = member.getName();
if (name.startsWith("class$"))
return true;
if (name.startsWith("access$"))
return true;
return false;
}
示例8: isSynthetic
import org.apache.bcel.classfile.FieldOrMethod; //导入依赖的package包/类
/**
* Figure out if a class member (field or method) is synthetic.
*
* @param member
* a field or method
* @return true if the member is synthetic
*/
private boolean isSynthetic(FieldOrMethod member) {
if (BCELUtil.isSynthetic(member)) // this never works, but worth a try
return true;
String name = member.getName();
if (name.startsWith("class$"))
return true;
if (name.startsWith("access$"))
return true;
return false;
}
示例9: isSynthetic
import org.apache.bcel.classfile.FieldOrMethod; //导入依赖的package包/类
public static boolean isSynthetic(FieldOrMethod m) {
if (m.isSynthetic())
return true;
for(Attribute a : m.getAttributes())
if (a instanceof Synthetic)
return true;
return false;
}
示例10: getFieldOrMethod
import org.apache.bcel.classfile.FieldOrMethod; //导入依赖的package包/类
/**
* Returns the FieldOrMethod.
* @return the FieldOrMethod.
*/
protected FieldOrMethod getFieldOrMethod()
{
return mFieldOrMethod;
}
示例11: isVisible
import org.apache.bcel.classfile.FieldOrMethod; //导入依赖的package包/类
private boolean isVisible(FieldOrMethod obj) {
return (obj.getAccessFlags() & ACC_PUBLIC) != 0 || (obj.getAccessFlags() & ACC_PROTECTED) != 0;
}
示例12: FieldOrMethodDefinition
import org.apache.bcel.classfile.FieldOrMethod; //导入依赖的package包/类
/**
* Constructs a <code>FieldOrMethodDefinition</code> for a Field
* or a Method.
* @param aFieldOrMethod the Field or Method
*/
protected FieldOrMethodDefinition(FieldOrMethod aFieldOrMethod)
{
mFieldOrMethod = aFieldOrMethod;
}