Search code examples
reflectionintrospectionvalagobject

Invocation handling in vala?


Is there something similar to java's InvocationHandler in vala. That is, I want to create an instance of an interface or class, giving implementation dynamically. I've read the docs about reflection, but it's quite limited and doesn't say anything about interfaces and abstracts, nor methods.


Solution

  • It's not possible to know the class/interface struct at runtime. Limitation inherited from C. On the other hand gobject does not allow specifying more metadata to access class/interface struct fields. The only "reflection" possible with gobject is about properties and the type of an object.