code: public List<Class<?>> getClassInfo(String root,String pkg) throws Exception
  	{
  		List<Class<?>> list=new ArrayList<Class<?>>();
  		String suffix=".java";
  		File rootDir=new File(root);
  		Set<File> files=FileUtil.findFileByDirAndSub(rootDir, new FileFilter() {
  			@Override
  			public boolean accept(File pathname) {
  				return pathname.isDirectory() || pathname.getName().endsWith(suffix);
  			}
  		});
  		URLClassLoader loader=new URLClassLoader(new URL[]{rootDir.toURI().toURL()});
  		try {
  			// 获取路径长度
  			int clazzPathLen = rootDir.getAbsolutePath().length() + 1;
  			for(File file:files)
  			{
  				String className = file.getAbsolutePath();
  				className = className.substring(clazzPathLen, className.length() - suffix.length());
  				className = className.replace(File.separatorChar, '.');
  				try {
  					Class<?> clazz=loader.loadClass(className);
  					String pkgName=clazz.getPackage().getName();
  					if(pkgName.startsWith(pkg))
  					{
  						list.add(clazz);
  					}
  				} catch (Exception e) {
  				}
  			}
  		} finally {
  			loader.close();
  		}
  		return list;
  	}
docs: 获取源码目录下指定包下的类
  @param root
  @param pkg
  @return
  @throws Exception