Jump to: navigation, search

Difference between revisions of "JET FAQ How do I use JMerge to manage user specific code?"

(Initial version)
 
m (Answer)
 
(One intermediate revision by the same user not shown)
Line 10: Line 10:
 
# Invoke the template from a <ws:file> or <java:class> tag.
 
# Invoke the template from a <ws:file> or <java:class> tag.
  
The <java:merge> tag has an effect if the file being written has a .java or .properties extension. See [[JET FAQ How does JMerge Work?]].
+
The <java:merge> tag has an effect if the file being written has a .java or .properties extension. See [[JET FAQ How does JMerge work?]].
  
 
= See Also =
 
= See Also =
[[JET FAQ What is JMerge?]]
+
* [[JET FAQ What is JMerge?]]
[[JET FAQ How does JMerge work?]]
+
* [[JET FAQ How does JMerge work?]]
[[JET FAQ How do I write custom JMerge rules?]]
+
* [[JET FAQ How do I write custom JMerge rules?]]
  
  

Latest revision as of 18:45, 1 August 2007

Question

The Eclipse Modeling Framework (EMF) includes a facility called JMerge for merging generated Java source into existing user edited Java classes. How do I make use of JMerge in JET?

Answer

Using JMerge in JET templates, it is pretty straight forward. You do the following:

  1. Place a <java:merge/> tag somewhere in the template generating a java class
  2. In the template, any Java element (class, method, field, ...) that you want to be updated by JMerge, add a @generated tag in the element's Java doc.
  3. Invoke the template from a <ws:file> or <java:class> tag.

The <java:merge> tag has an effect if the file being written has a .java or .properties extension. See JET FAQ How does JMerge work?.

See Also


Back to the M2T-JET-FAQ