mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#1105 cleaning up MethodReference freemarker template
This commit is contained in:
parent
8353f53ab9
commit
58992b8edf
@ -21,20 +21,30 @@
|
|||||||
-->
|
-->
|
||||||
<@compress single_line=true>
|
<@compress single_line=true>
|
||||||
<#-- method is either internal to the mapper class, or external (via uses) declaringMapper!=null -->
|
<#-- method is either internal to the mapper class, or external (via uses) declaringMapper!=null -->
|
||||||
<#if declaringMapper??><#if static><@includeModel object=declaringMapper.type/><#else>${mapperVariableName}</#if>.<@methodCall/>
|
<#if declaringMapper??>
|
||||||
|
<#if static><@includeModel object=declaringMapper.type/><#else>${mapperVariableName}</#if>.<@methodCall/>
|
||||||
<#-- method is provided by a context parameter -->
|
<#-- method is provided by a context parameter -->
|
||||||
<#elseif providingParameter??><#if static><@includeModel object=providingParameter.type/><#else>${providingParameter.name}</#if>.<@methodCall/>
|
<#elseif providingParameter??>
|
||||||
|
<#if static><@includeModel object=providingParameter.type/><#else>${providingParameter.name}</#if>.<@methodCall/>
|
||||||
<#-- method is referenced java8 static method in the mapper to implement (interface) -->
|
<#-- method is referenced java8 static method in the mapper to implement (interface) -->
|
||||||
<#elseif static><@includeModel object=definingType/>.<@methodCall/>
|
<#elseif static>
|
||||||
|
<@includeModel object=definingType/>.<@methodCall/>
|
||||||
<#else>
|
<#else>
|
||||||
<@methodCall/>
|
<@methodCall/>
|
||||||
</#if>
|
</#if>
|
||||||
<#macro methodCall>
|
</@compress>
|
||||||
<@compress>
|
<#--
|
||||||
${name}<#if (parameterBindings?size > 0)>( <@arguments/> )<#else>()</#if>
|
macro: methodCall
|
||||||
</@compress>
|
purpose: the actual method call (stuff following the dot)
|
||||||
</#macro>
|
-->
|
||||||
<#macro arguments>
|
<#macro methodCall>
|
||||||
|
<#lt>${name}<#if (parameterBindings?size > 0)>( <@arguments/> )<#else>()</#if>
|
||||||
|
</#macro>
|
||||||
|
<#--
|
||||||
|
macro: arguments
|
||||||
|
purpose: the arguments in the method call
|
||||||
|
-->
|
||||||
|
<#macro arguments>
|
||||||
<#list parameterBindings as param>
|
<#list parameterBindings as param>
|
||||||
<#if param.targetType>
|
<#if param.targetType>
|
||||||
<#-- a class is passed on for casting, see @TargetType -->
|
<#-- a class is passed on for casting, see @TargetType -->
|
||||||
@ -52,13 +62,16 @@
|
|||||||
</#list>
|
</#list>
|
||||||
<#-- context parameter, e.g. for builtin methods concerning date conversion -->
|
<#-- context parameter, e.g. for builtin methods concerning date conversion -->
|
||||||
<#if contextParam??>, ${contextParam}</#if><#t>
|
<#if contextParam??>, ${contextParam}</#if><#t>
|
||||||
</#macro>
|
</#macro>
|
||||||
<#macro _assignment>
|
<#--
|
||||||
|
macro: assignment
|
||||||
|
purpose: note: takes its targetyType from the singleSourceParameterType
|
||||||
|
-->
|
||||||
|
<#macro _assignment>
|
||||||
<@includeModel object=assignment
|
<@includeModel object=assignment
|
||||||
targetBeanName=ext.targetBeanName
|
targetBeanName=ext.targetBeanName
|
||||||
existingInstanceMapping=ext.existingInstanceMapping
|
existingInstanceMapping=ext.existingInstanceMapping
|
||||||
targetReadAccessorName=ext.targetReadAccessorName
|
targetReadAccessorName=ext.targetReadAccessorName
|
||||||
targetWriteAccessorName=ext.targetWriteAccessorName
|
targetWriteAccessorName=ext.targetWriteAccessorName
|
||||||
targetType=singleSourceParameterType/>
|
targetType=singleSourceParameterType/>
|
||||||
</#macro>
|
</#macro>
|
||||||
</@compress>
|
|
Loading…
x
Reference in New Issue
Block a user