mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
Minor formatting fixes of generated code
This commit is contained in:
parent
08cf60e46a
commit
3e81651455
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
-->
|
-->
|
||||||
@Override
|
@Override
|
||||||
<#lt>${accessibility.keyword} <@includeModel object=returnType/> ${name}(<#list parameters as param><@includeModel object=param/><#if param_has_next>, </#if></#list>) <@throws/> {
|
<#lt>${accessibility.keyword} <@includeModel object=returnType/> ${name}(<#list parameters as param><@includeModel object=param/><#if param_has_next>, </#if></#list>)<@throws/> {
|
||||||
<#if !mapNullToDefault>
|
<#if !mapNullToDefault>
|
||||||
if ( <#list sourceParametersExcludingPrimitives as sourceParam>${sourceParam.name} == null<#if sourceParam_has_next> && </#if></#list> ) {
|
if ( <#list sourceParametersExcludingPrimitives as sourceParam>${sourceParam.name} == null<#if sourceParam_has_next> && </#if></#list> ) {
|
||||||
return<#if returnType.name != "void"> null</#if>;
|
return<#if returnType.name != "void"> null</#if>;
|
||||||
@ -61,10 +61,10 @@
|
|||||||
}
|
}
|
||||||
<#macro throws>
|
<#macro throws>
|
||||||
<@compress single_line=true>
|
<@compress single_line=true>
|
||||||
<#if (thrownTypes?size > 0)>throws </#if>
|
<#if (thrownTypes?size > 0)> throws </#if>
|
||||||
<#list thrownTypes as exceptionType>
|
<#list thrownTypes as exceptionType>
|
||||||
<@includeModel object=exceptionType/>
|
<@includeModel object=exceptionType/>
|
||||||
<#if exceptionType_has_next>, </#if>
|
<#if exceptionType_has_next>, </#if>
|
||||||
</#list>
|
</#list>
|
||||||
</@compress>
|
</@compress>
|
||||||
</#macro>
|
</#macro>
|
@ -37,7 +37,6 @@ import ${importedType.importName};
|
|||||||
<#nt> <@includeModel object=field/>
|
<#nt> <@includeModel object=field/>
|
||||||
</#list>
|
</#list>
|
||||||
<#list methods as method>
|
<#list methods as method>
|
||||||
|
|
||||||
<#nt> <@includeModel object=method/>
|
<#nt> <@includeModel object=method/>
|
||||||
</#list>
|
</#list>
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
-->
|
-->
|
||||||
<#if overridden>@Override</#if>
|
<#if overridden>@Override</#if>
|
||||||
<#lt>${accessibility.keyword} <@includeModel object=returnType/> ${name}(<#list parameters as param><@includeModel object=param/><#if param_has_next>, </#if></#list>) <@throws/> {
|
<#lt>${accessibility.keyword} <@includeModel object=returnType/> ${name}(<#list parameters as param><@includeModel object=param/><#if param_has_next>, </#if></#list>)<@throws/> {
|
||||||
if ( ${sourceParameter.name} == null ) {
|
if ( ${sourceParameter.name} == null ) {
|
||||||
<#if !mapNullToDefault>
|
<#if !mapNullToDefault>
|
||||||
<#-- returned target type starts to miss-align here with target handed via param, TODO is this right? -->
|
<#-- returned target type starts to miss-align here with target handed via param, TODO is this right? -->
|
||||||
@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
<#if resultType.arrayType>
|
<#if resultType.arrayType>
|
||||||
<#if !existingInstanceMapping>
|
<#if !existingInstanceMapping>
|
||||||
<@includeModel object=resultElementType/>[] ${resultName} = new <@includeModel object=resultElementType/>[ <@iterableSize/> ];
|
<@includeModel object=resultElementType/>[] ${resultName} = new <@includeModel object=resultElementType/>[<@iterableSize/>];
|
||||||
</#if>
|
</#if>
|
||||||
int ${index1Name} = 0;
|
int ${index1Name} = 0;
|
||||||
for ( <@includeModel object=sourceElementType/> ${loopVariableName} : ${sourceParameter.name} ) {
|
for ( <@includeModel object=sourceElementType/> ${loopVariableName} : ${sourceParameter.name} ) {
|
||||||
@ -79,7 +79,7 @@
|
|||||||
}
|
}
|
||||||
<#macro throws>
|
<#macro throws>
|
||||||
<@compress single_line=true>
|
<@compress single_line=true>
|
||||||
<#if (thrownTypes?size > 0)>throws </#if>
|
<#if (thrownTypes?size > 0)> throws </#if>
|
||||||
<#list thrownTypes as exceptionType>
|
<#list thrownTypes as exceptionType>
|
||||||
<@includeModel object=exceptionType/>
|
<@includeModel object=exceptionType/>
|
||||||
<#if exceptionType_has_next>, </#if>
|
<#if exceptionType_has_next>, </#if>
|
||||||
@ -117,4 +117,4 @@
|
|||||||
</#if>()
|
</#if>()
|
||||||
</#if>
|
</#if>
|
||||||
</@compress>
|
</@compress>
|
||||||
</#macro>
|
</#macro>
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
-->
|
-->
|
||||||
<#if overridden>@Override</#if>
|
<#if overridden>@Override</#if>
|
||||||
<#lt>${accessibility.keyword} <@includeModel object=returnType /> ${name}(<#list parameters as param><@includeModel object=param/><#if param_has_next>, </#if></#list>) <@throws/> {
|
<#lt>${accessibility.keyword} <@includeModel object=returnType /> ${name}(<#list parameters as param><@includeModel object=param/><#if param_has_next>, </#if></#list>)<@throws/> {
|
||||||
if ( ${sourceParameter.name} == null ) {
|
if ( ${sourceParameter.name} == null ) {
|
||||||
<#if !mapNullToDefault>
|
<#if !mapNullToDefault>
|
||||||
return<#if returnType.name != "void"> null</#if>;
|
return<#if returnType.name != "void"> null</#if>;
|
||||||
@ -58,7 +58,7 @@
|
|||||||
}
|
}
|
||||||
<#macro throws>
|
<#macro throws>
|
||||||
<@compress single_line=true>
|
<@compress single_line=true>
|
||||||
<#if (thrownTypes?size > 0)>throws </#if>
|
<#if (thrownTypes?size > 0)> throws </#if>
|
||||||
<#list thrownTypes as exceptionType>
|
<#list thrownTypes as exceptionType>
|
||||||
<@includeModel object=exceptionType/>
|
<@includeModel object=exceptionType/>
|
||||||
<#if exceptionType_has_next>, </#if>
|
<#if exceptionType_has_next>, </#if>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user