Java examples for java.lang.annotation:Class Annotation
find Annotated Classes
//package com.java2s; import java.lang.annotation.Annotation; import java.util.ArrayList; import java.util.List; public class Main { static public <T extends Annotation> List<Class<?>> findAnnotatedClasses( String pkg, Class<T> annotatedClass) throws Exception { List<Class<?>> holder = new ArrayList<Class<?>>(); Package pkgObj = Package.getPackage(pkg); Package[] children = pkgObj.getPackages(); return holder; }/*from ww w.j a va 2 s . c om*/ }