find Annotated Classes - Java java.lang.annotation

Java examples for java.lang.annotation:Class Annotation

Description

find Annotated Classes

Demo Code


//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*/
}

Related Tutorials