Updating of source JAVA file consist in :
There is sample into Components/CodeUpdater/Java directory of usecases-catalog catalog.
To do that, you must :
<models> <model key="javaClass" type="java" /> </models>
Here sample which add field content into existing JAVA file :
<output> <file key="javaClass" > <insert path="field" > <template uri="/ftl/CodeUpdater/Java/AddJavaField.ftl" /> </insert> </file> </output>
To set source JAVA file to update (which is defined into model), key attribute of the file element must refer key attribute of model element.
private String ${fieldName};
Model definition type of java and with javaClass is done like this :
... <models> <model type="java" key="javaClass" /> ... </models> ...
file element is inside output element. It is able to describe the updating to do on JAVA source file which is defined into model. Updating source JAVA file with key javaClass :
... <output> <file key="javaClass" > ... </file> </output> ...
insert element is inside file element. It is able to insert method/field content with path attribute :
... <file key="javaClass" > <insert path="method|field" > <template uri="..." /> </insert> </file> ...
Method/field content to insert is generated. This generation can be done with template (Freemarker, velocity, XSL,...).
To generate method/field content with template path_of_myTemplate, insert must contain :
... <insert path="method|field" > <template uri="path_of_myTemplate" /> </insert> ...