hutcheb commented on a change in pull request #230:
URL: https://github.com/apache/plc4x/pull/230#discussion_r603137491
##########
File path:
build-utils/language-java/src/main/resources/templates/java/enum-template.ftlh
##########
@@ -59,7 +59,7 @@ import java.util.Map;
public enum ${type.name} {
<#list type.enumValues as enumValue>
- ${enumValue.name}(<#if
type.type?has_content>(${helper.getLanguageTypeNameForTypeReference(type.type,
true)}) <#if
helper.isStringTypeReference(type.type)>"${enumValue.value}"<#else>${enumValue.value}</#if></#if><#if
type.constantNames?has_content><#if type.type?has_content>, </#if><#list
type.constantNames as
constantName>(${helper.getLanguageTypeNameForTypeReference(type.getConstantType(constantName),
true)}) ${helper.escapeValue(type.getConstantType(constantName),
enumValue.getConstant(constantName))}<#sep>, </#sep></#list></#if>)<#sep>,
+ ${enumValue.name}(<#if
type.type?has_content>(${helper.getLanguageTypeNameForTypeReference(type.type,
true)}) <#if
helper.isStringTypeReference(type.type)>"${enumValue.value}"<#elseif
helper.isComplexTypeReference(type.type)><#if
helper.isEnumTypeReference(type.type)>${helper.getLanguageTypeNameForTypeReference(type.type,
true)}.${enumValue.value}<#else>${enumValue.value}</#if><#else>${enumValue.value}</#if></#if><#if
type.constantNames?has_content><#if type.type?has_content>, </#if><#list
type.constantNames as constantName><#if
helper.isComplexTypeReference(type.getConstantType(constantName))><#if
helper.escapeValue(type.getConstantType(constantName),
enumValue.getConstant(constantName)) == 'null'>null<#elseif
helper.isEnumTypeReference(type.getConstantType(constantName))>${helper.getLanguageTypeNameForTypeReference(type.getConstantType(constantName),
true)}.${helper.escapeValue(type.getConstantType(constantName),
enumValue.getConstant(constantName))}<#else>(${helper.getLanguag
eTypeNameForTypeReference(type.getConstantType(constantName), true)})
${helper.escapeValue(type.getConstantType(constantName),
enumValue.getConstant(constantName))}</#if><#else>(${helper.getLanguageTypeNameForTypeReference(type.getConstantType(constantName),
true)}) ${helper.escapeValue(type.getConstantType(constantName),
enumValue.getConstant(constantName))}</#if><#sep>, </#sep></#list></#if>)<#sep>,
Review comment:
` {/* ${helper.getCTypeName(name)} */
<#if true> </#if><@compress single_line=true>
<#list typeValues as key, value>
<#if
!helper.isComplexTypeReference(helper.getDiscriminatorTypes()[key])>
.${key} = <#if value??>${value}<#else>-1</#if><#sep>,
<#else>
.${key} = <#if
value??>${helper.getLanguageTypeNameForTypeReference(helper.getDiscriminatorTypes()[key])}_${value}<#else>-1</#if><#sep>,
</#if></#list>}<#sep >,
</@compress>`
Something like that seems to work ok anything between the compress tags
strips all multiple white space/line breaks to a single space, @chrisdutz what
do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]