
eJava - Java specifications for Ecore's EOperation bodies
A common issue that arises when custom code is needed in EMF-based meta models is the mixing of generated and hand-written code. The problem can be solved using eJava. eJava is based on Java and Ecore. It can be used to specify the behaviour of EOperations with Java statements in separate files on the modelling level.
To provide the implementation for EOperations one simply puts an eJava file next to the Ecore model. eJava automatically adds the code then as Annotation to the EOperation elements in the ecore model. Afterwards the EMF code generation can be used as it is and the generated classes contain the methods from the eJava files. This way, hand-written and generated code is cleanly separated. eJava does also check the implemented methods to make sure no compilation problems occur after generating the code for a Ecore model.
org.emftext.language.java.ejava
org.emftext.language.java.ejava.edit
org.emftext.language.java.ejava.resource
org.emftext.language.java.ejava.resource.ejava
org.emftext.language.java.ejava.resource.ejava.ui