本文整理汇总了Java中org.eclipse.jdt.core.util.IClassFileReader.getMethodInfos方法的典型用法代码示例。如果您正苦于以下问题:Java IClassFileReader.getMethodInfos方法的具体用法?Java IClassFileReader.getMethodInfos怎么用?Java IClassFileReader.getMethodInfos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.core.util.IClassFileReader
的用法示例。
在下文中一共展示了IClassFileReader.getMethodInfos方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSortedMethods
import org.eclipse.jdt.core.util.IClassFileReader; //导入方法依赖的package包/类
private static IMethodInfo[] getSortedMethods(IClassFileReader cfReader) {
IMethodInfo[] allMethods = cfReader.getMethodInfos();
Arrays.sort(allMethods, new Comparator<IMethodInfo>() {
@Override
public int compare(IMethodInfo mi1, IMethodInfo mi2) {
if (mi1.isConstructor() != mi2.isConstructor()) {
return mi1.isConstructor() ? -1 : 1;
} else if (mi1.isConstructor()) {
return 0;
}
int res = CharOperation.compareTo(mi1.getName(), mi2.getName());
if (res != 0) {
return res;
}
return CharOperation.compareTo(mi1.getDescriptor(), mi2.getDescriptor());
}
});
return allMethods;
}
示例2: getSortedMethods
import org.eclipse.jdt.core.util.IClassFileReader; //导入方法依赖的package包/类
private static IMethodInfo[] getSortedMethods(IClassFileReader cfReader) {
IMethodInfo[] allMethods= cfReader.getMethodInfos();
Arrays.sort(allMethods, new Comparator<IMethodInfo>() {
public int compare(IMethodInfo mi1, IMethodInfo mi2) {
if (mi1.isConstructor() != mi2.isConstructor()) {
return mi1.isConstructor() ? -1 : 1;
} else if (mi1.isConstructor()) {
return 0;
}
int res= CharOperation.compareTo(mi1.getName(), mi2.getName());
if (res != 0) {
return res;
}
return CharOperation.compareTo(mi1.getDescriptor(), mi2.getDescriptor());
}
});
return allMethods;
}
示例3: hasStaticClassInitializer
import org.eclipse.jdt.core.util.IClassFileReader; //导入方法依赖的package包/类
private static boolean hasStaticClassInitializer(IClassFileReader cfReader) {
IMethodInfo[] methodInfos = cfReader.getMethodInfos();
for (int i = 0; i < methodInfos.length; i++) {
if (methodInfos[i].isClinit()) {
return true;
}
}
return false;
}
示例4: hasStaticClassInitializer
import org.eclipse.jdt.core.util.IClassFileReader; //导入方法依赖的package包/类
private static boolean hasStaticClassInitializer(IClassFileReader cfReader) {
IMethodInfo[] methodInfos= cfReader.getMethodInfos();
for (int i= 0; i < methodInfos.length; i++) {
if (methodInfos[i].isClinit()) {
return true;
}
}
return false;
}
示例5: checkClassFile
import org.eclipse.jdt.core.util.IClassFileReader; //导入方法依赖的package包/类
private boolean checkClassFile(IClassFileReader classFileReader) {
IMethodInfo[] methodInfos = classFileReader.getMethodInfos();
for (int i = 0, max = methodInfos.length; i < max; i++) {
ICodeAttribute codeAttribute = methodInfos[i].getCodeAttribute();
if (codeAttribute != null && codeAttribute.getLineNumberAttribute() != null) {
return true;
}
}
return false;
}