annoted class shown below present inside MySample project
@Description(name = "foo", description = "bar")
public class Test {
//////
}
Fetching vales from jar in below code
File file = new File("MySample.jar");
URL url = file.toURL();
URL[] urls = new URL[]{url};
ClassLoader cl = new URLClassLoader(urls);
Class cls = cl.loadClass("com.example.Test");
Description annotations = cls.getClass().getAnnotation(Description.class);
// annotations instance is null
Because of annotations instance null i am not able to fetch vales.
Does any one have idea how to solve this problem or any other alternatives ?
Aucun commentaire:
Enregistrer un commentaire