I don't think there is. There's a lot of things I wish I could do with the reflection module that you kinda can't do right now (and might not ever?!). To unpack serialized metadata into objects for one of my libraries, I had to use a kinda weird system that involved a singleton factory instance that the programmer has to "hint" to in order to construct classes that aren't normally supported by it. The classes have to have a builder method themselves in order to construct new instances of their own type.
You could store metadata as named instance variables, but of course that's inefficient. (That's what I ended up doing, however.)
|