函数背景:希望得到jar包中所有函数和包名,便于在客户端以树型结构展示
public static List<String[]> getJarMethod(String jarFile) throws Exception {
String NORMAL_METHOD= "waitequalsnotifynotifyAlltoStringhashCodegetClass";
List<String[]> a = new ArrayList<String[]>();
try {
//通过jarFile 和JarEntry得到所有的类
JarFile jar = new JarFile(jarFile);//"D:/sip-test.jar"
Enumeration e = jar.entries();
while (e.hasMoreElements()) {
JarEntry entry = (JarEntry) e.nextElement();
//entry.getMethod()
if (entry.getName().indexOf("META-INF") < 0) {
String sName = entry.getName();
String substr[] = sName.split("/");
String pName = "";