branch develop updated (4f5d47e -> 5b9c110)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository eugene. See https://gitlab.nuiton.org/nuiton/eugene.git from 4f5d47e resourcesHelper in Template must be reset at each init (Fixes #4037) new 5b9c110 Improve application configuration generation (See #4036) The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 5b9c11024074a2cce77f99917c2dec101a79a293 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Sep 15 19:25:37 2016 +0200 Improve application configuration generation (See #4036) Summary of changes: .../templates/ApplicationConfigTransformer.java | 32 +++++++++++++++------- 1 file changed, 22 insertions(+), 10 deletions(-) -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository eugene. See https://gitlab.nuiton.org/nuiton/eugene.git commit 5b9c11024074a2cce77f99917c2dec101a79a293 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Sep 15 19:25:37 2016 +0200 Improve application configuration generation (See #4036) --- .../templates/ApplicationConfigTransformer.java | 32 +++++++++++++++------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/eugene-config-templates/src/main/java/org/nuiton/eugene/config/templates/ApplicationConfigTransformer.java b/eugene-config-templates/src/main/java/org/nuiton/eugene/config/templates/ApplicationConfigTransformer.java index 4604f20..e1e3d24 100644 --- a/eugene-config-templates/src/main/java/org/nuiton/eugene/config/templates/ApplicationConfigTransformer.java +++ b/eugene-config-templates/src/main/java/org/nuiton/eugene/config/templates/ApplicationConfigTransformer.java @@ -73,19 +73,31 @@ public class ApplicationConfigTransformer extends ObjectModelTransformerToJava { if (log.isInfoEnabled()) { log.info("Generate " + output.getQualifiedName()); } - addAttribute(output, "delegate", ApplicationConfig.class, "", ObjectModelJavaModifier.PRIVATE); + addAttribute(output, "applicationConfig", ApplicationConfig.class, "", ObjectModelJavaModifier.PRIVATE); ObjectModelOperation constructor = addConstructor(output, ObjectModelJavaModifier.PROTECTED); setOperationBody(constructor, "" /*{ - this.delegate = new ApplicationConfig(); + this.applicationConfig = new ApplicationConfig(); }*/ ); - ObjectModelOperation getDelegate = addOperation(output, "getDelegate", ApplicationConfig.class, ObjectModelJavaModifier.PROTECTED); - setOperationBody(getDelegate, "" + ObjectModelOperation getApplicationConfig = addOperation( + output, "getApplicationConfig", ApplicationConfig.class, ObjectModelJavaModifier.PROTECTED); + setOperationBody(getApplicationConfig, "" /*{ - return delegate; + return applicationConfig; + }*/ + ); + + ObjectModelOperation setOption = addOperation( + output, "setOption", "void", ObjectModelJavaModifier.PROTECTED); + addParameter(setOption, String.class, "key"); + addParameter(setOption, Object.class, "attrName"); + + setOperationBody(setOption, "" + /*{ + applicationConfig.setOption(key, String.valueOf(attrName)); }*/ ); @@ -183,7 +195,7 @@ public class ApplicationConfigTransformer extends ObjectModelTransformerToJava { methodName = "getOptionAsObject"; setOperationBody(operation, "" /*{ - return (<%=simpleType%>) delegate.<%=methodName%>(<%=simpleType%>.class, <%=constantName%>.getKey()); + return (<%=simpleType%>) applicationConfig.<%=methodName%>(<%=simpleType%>.class, <%=constantName%>.getKey()); }*/ ); } else @@ -191,7 +203,7 @@ public class ApplicationConfigTransformer extends ObjectModelTransformerToJava { { setOperationBody(operation, "" /*{ - return delegate.<%=methodName%>(<%=constantName%>.getKey()); + return applicationConfig.<%=methodName%>(<%=constantName%>.getKey()); }*/ ); @@ -205,7 +217,7 @@ public class ApplicationConfigTransformer extends ObjectModelTransformerToJava { setOperationBody(operation, "" /*{ - return delegate.<%=methodName%>(<%=constantName%>.getKey()); + return applicationConfig.<%=methodName%>(<%=constantName%>.getKey()); }*/ ); } @@ -229,7 +241,7 @@ public class ApplicationConfigTransformer extends ObjectModelTransformerToJava { String methodName = getJavaBeanMethodName(methodPrefix, attrName); setOperationBody(operation, "" /*{ - delegate.setOption(<%=constantName%>.getKey(), String.valueOf(<%=attrName%>)); + setOption(<%=constantName%>.getKey(), <%=attrName%>); }*/ ); @@ -244,7 +256,7 @@ public class ApplicationConfigTransformer extends ObjectModelTransformerToJava { setOperationBody(operation, "" /*{ - delegate.setOption(<%=constantName%>.getKey(), String.valueOf(<%=attrName%>)); + setOption(<%=constantName%>.getKey(), <%=attrName%>); }*/ ); } -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
participants (1)
-
nuiton.org scm