#Java Reflection Problem
7 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @stoic forge! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Hey Mytho, just for some clarification on your question are you saying that in a hypothetical statement lets say we have the classes Dog, Cat, and Bird that all inherit the abstract class Animal. You're wondering if there is a way to get a list of all classes that inherit Animal so in this case it would be [Dog, Cat, Bird]?
If so, you could look into this library (though I've never personally used it for this exact case) however it may contain what you are looking for: https://github.com/ronmamo/reflections
I don't know of any way to exactly perform that action in native java though but maybe someone has a better solution
Yes, your hypothetical is correct.
I would need to get a list of all classes that inherit from ClassName.
I'll look into the library, thanks for the link.