You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2019/08/30 14:51:15 UTC

[plc4x] 01/02: - Adjusted the java template to respect the "passive" output flavor

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 7f3847fecb53ffff7f0453e034bee6db39e595e0
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Fri Aug 30 16:18:09 2019 +0200

    - Adjusted the java template to respect the "passive" output flavor
---
 .../language-java/src/main/resources/templates/java/io-template.ftlh  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/build-utils/language-java/src/main/resources/templates/java/io-template.ftlh b/build-utils/language-java/src/main/resources/templates/java/io-template.ftlh
index 27d7421..b42dfbc 100644
--- a/build-utils/language-java/src/main/resources/templates/java/io-template.ftlh
+++ b/build-utils/language-java/src/main/resources/templates/java/io-template.ftlh
@@ -48,7 +48,7 @@ import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.*;
 
-public class ${typeName}IO implements MessageIO<${typeName}<#if helper.isDiscriminatedType(type)>IO.${typeName}Builder</#if>, ${typeName}> {
+public class ${typeName}IO implements <#if outputFlavor == "passive">MessageInput<${typeName}<#if helper.isDiscriminatedType(type)>IO.${typeName}Builder</#if>><#else>MessageIO<${typeName}<#if helper.isDiscriminatedType(type)>IO.${typeName}Builder</#if>, ${typeName}></#if> {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(${typeName}IO.class);
 
@@ -281,6 +281,7 @@ public class ${typeName}IO implements MessageIO<${typeName}<#if helper.isDiscrim
         </#if>
     }
 
+<#if outputFlavor != "passive">
     public void serialize(WriteBuffer io, ${typeName} value, Object... args) throws ParseException {
 <#if type.parserArguments?has_content>
 <#list type.parserArguments as parserArgument>
@@ -389,6 +390,7 @@ public class ${typeName}IO implements MessageIO<${typeName}<#if helper.isDiscrim
 </#switch>
 </#list>
     }
+</#if>
 
     private static int COUNT(Object obj) {
         if(obj.getClass().isArray()) {