@Test public void testme(){ String simple = PackageUtil.simplifyName("com.wangyin.ak47.common.PackageUtil"); Assert.assertEquals("c.w.a.c.PackageUtil", simple); }
public static String simplifyName(String classname){ String[] cns = classname.split("\\."); StringBuilder sb = new StringBuilder(32); for(int i=0; i<cns.length-1; i++){ sb.append(cns[i].charAt(0)).append("."); } sb.append(cns[cns.length-1]); return sb.toString(); }
PackageUtil { public static String simplifyName(String classname){ String[] cns = classname.split("\\."); StringBuilder sb = new StringBuilder(32); for(int i=0; i<cns.length-1; i++){ sb.append(cns[i].charAt(0)).append("."); } sb.append(cns[cns.length-1]); return sb.toString(); } }
PackageUtil { public static String simplifyName(String classname){ String[] cns = classname.split("\\."); StringBuilder sb = new StringBuilder(32); for(int i=0; i<cns.length-1; i++){ sb.append(cns[i].charAt(0)).append("."); } sb.append(cns[cns.length-1]); return sb.toString(); }  }
PackageUtil { public static String simplifyName(String classname){ String[] cns = classname.split("\\."); StringBuilder sb = new StringBuilder(32); for(int i=0; i<cns.length-1; i++){ sb.append(cns[i].charAt(0)).append("."); } sb.append(cns[cns.length-1]); return sb.toString(); }  static String simplifyName(String classname); static void addExtJars(String jarfile); }
PackageUtil { public static String simplifyName(String classname){ String[] cns = classname.split("\\."); StringBuilder sb = new StringBuilder(32); for(int i=0; i<cns.length-1; i++){ sb.append(cns[i].charAt(0)).append("."); } sb.append(cns[cns.length-1]); return sb.toString(); }  static String simplifyName(String classname); static void addExtJars(String jarfile);  }