In Java, is there a way to find all classes within a package that are serializable and then add the Class object for these classes to a collection?
Printable View
In Java, is there a way to find all classes within a package that are serializable and then add the Class object for these classes to a collection?
Not via the API, as far as I'm aware. I think you would have to directly process byte code. I went searching through the ClassLoader API and the Package API and was surprised to find that there does not seem to be any way to get a collection of classes.