Community
Participate
Working Groups
When invoking EGL from Java, assignments to a template variable fail with the following error: Illegal assignment to variable 't'. Expected Template and found org.eclipse.epsilon.egl.EglTemplate Exemplar client code: public static void main(String[] args) { EglTemplateFactory tf = new EglTemplateFactory(); EglTemplate template = null; try { File f = FileUtil.getFile("absolute.egl", Runner.class); template = tf.load(f); } catch (Exception e) { e.printStackTrace(); } try { String output = template.process(); System.out.println(output); } catch (EolRuntimeException r) { r.printStackTrace(); } } Contents of EGL template: [% var t : Template := TemplateFactory.load('file:///Users/louis/Code/eclipse/workspaces/helios/epsilon-user/egl.problem/src/problem/simple.egl'); %] [%=t.process()%]
This is a bug, caused by EglComplexType mandating that Template variables are of type EglFileGeneratingTemplate. I've changed EglComplexType to type-check Template variables against EglTemplate instead.
I've checked a fix into SVN. Assigning to Dimitris for build integration - thanks!
Fixed in 0.9.0.