.jar to .cs class/file transform technique or utility?

Deadly 提交于 2020-01-06 06:09:43

问题


I am looking for a way to transform some classes from Java to .Net in a code gen way.

Not at run time, but re-generate a handful of business objects as needed (not often).

the catch is, i want to have full control of how they end up. So while java classes have get and set methods, i will create a property out of them.

the only way i can think of for now, is to read the file using c#, get the necessary members, and maybe feed them to a code gen template. at the very lease, i could throw them into a database, and something like code smith could generate .net classes based on a template and the updated database table.

any other ideas/utilities?

my solution was to use reflection to write out java class members as xml, and than plugging that into codesmith template to create .net classes. the neat part is that it can be automated as a step on build server


回答1:


Have a look at IKVM.



来源:https://stackoverflow.com/questions/3818456/jar-to-cs-class-file-transform-technique-or-utility

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!