I want to dynamically create a class composition map by enumerating private fields of a given set of classes. This works well with getDeclaredFields() with an isolated set of classes.
But if the class contains a field which type is a class that is not available, the call fails with NoClassDefFoundError
. Is there any way to enumerate private fields so that I can avoid this behaviour, for example one by one and catching the exception and carry on with rest of the fields?