Dynamic class definition


Hi team,
we are developing an application framework, where the business objects are defined in every project dynamically. The business object definition is saved in the database, but could also be exported into an xml file, for example.

Basically, one could write code using these business objects (which all extend the same super class).
That means, that after having defined the object definition (using our own business object designer), we would have to implement the classes to use them in the source code.

What we now want to achieve is that the classes are generated automatically, using the xml file or a database connection. The class files themselves do not necessarily have to be part of the source code (physically), but we want to be able to compile the code and to use intellisense for those classes.

Is there any way to propagate class definitions for the IDE at runtime?

Thanks in advance,

评论操作 固定链接

Extension points com.intellij.psi.PsiElementFinder and com.intellij.psi.augment.PsiAugmentProvider can be used to provide "virtual" code elements at runtime.