Answer the question
In order to leave comments, you need to log in
Is there a templating engine with the ability to parse back into an object?
Here is an example of the desired API
class TemplateEngineTest {
private final static String TEMPLATE = "<test>${testName}</test>";
private Object templateEngine;
public void testEngine() {
TestDtoObject dto = new TestDtoObject();
String renderedTemplate = templateEngine.render(TEMPLATE, dto);
assert renderedTemplate.equals("<test>myTestName</test>");
TestDtoObject resultDtr = templateEngine.unrender(TEMPLATE, renderedTemplate, TestDtoObject.class);
assert dto.equals(resultDtr);
}
static class TestDtoObject {
String testName = "myTestName";
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question