Unfortunately, we don't currently have a Java code generator from NORMA. Although a Java class would not work directly in a Visual Studio project, there is no theoretical reason that NORMA couldn't generate one. The structure of the classes would be very similar to the .NET classes--at least those spit by the PLiX Implementation generator, which doesn't use LINQ--and we could share much of the infrastructure. The issues are as follows:
- Code generation for .NET makes extensive use of partial classes. This means that the generated and hand written code for a given class can exist in separate files, and a generator can fully replace or delete a file without fear of overwriting hand-written code. This is not the case for Java, where there is a 1-1 relationship between a class and a file, and the file location is significant. This means that an integrated code generator needs to locate the real class, do some basic parsing to figure out where 'inside the class' is as well as where any previous spit from the same generator occurred, and insert/replace the generated code. Obviously, there are also issues when a generator is removed. This code injection (plus protecting the code in the generated region) will be different for each Java tool and editor. This would not be low-hanging fruit, and it is unlikely that NORMA or PLiX would attempt this any time soon. You would need to manually take any generated code and paste it into the appropriate .java file. Alternately, you have to make major changes to the class to support double derivation.
- Obviously, the support classes and associated methods from runtime support libraries are different between .NET and Java (String, List, Dictionary, etc.).
So, while generating the language parts would be relatively easy, different levels of conceptual support in the languages (especially when dealing with delegates, events and partial classes) will require some major reworking. Determining how you want to integrate the classes would also be interesting.
I am likely to need ORM-generated Java for an upcoming contract, so some of these areas may progress, but I can't given any timeframe. I would be happy to work with anyone who wants to suggest the Java patterns they want to see generated. Note that the generated MODELFILE.CLIProperties.xml file is an intermediate input for the plix implementation classes and I don't see any major issues using this to spit other class models.