All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.mapstruct.ap.internal.model.NestedPropertyMappingMethod.ftl Maven / Gradle / Ivy

There is a newer version: 1.6.3
Show newest version
<#--

    Copyright MapStruct Authors.

    Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0

-->
<#-- @ftlvariable name="" type="org.mapstruct.ap.internal.model.NestedPropertyMappingMethod" -->
<#lt>private <@includeModel object=returnType.typeBound/> ${name}(<#list parameters as param><@includeModel object=param/><#if param_has_next>, )<@throws/> {
    if ( ${sourceParameter.name} == null ) {
        return ${returnType.null};
    }
<#list propertyEntries as entry>
    <#if entry.presenceCheckerName?? >
    if ( <#if entry_index != 0><@localVarName index=entry_index/> == null || !<@localVarName index=entry_index/>.${entry.presenceCheckerName}() ) {
        return ${returnType.null};
    }
    
    <@includeModel object=entry.type.typeBound/> ${entry.name} = <@localVarName index=entry_index/>.${entry.accessorName};
    <#if !entry.presenceCheckerName?? >
    <#if !entry.type.primitive>
    if ( ${entry.name} == null ) {
        return ${returnType.null};
    }
    
    
    <#if !entry_has_next>
    return ${entry.name};
    

}
<#macro localVarName index><#if index == 0>${sourceParameter.name}<#else>${propertyEntries[index-1].name}
<#macro throws>
    <#if (thrownTypes?size > 0)><#lt> throws <@compress single_line=true>
        <#list thrownTypes as exceptionType>
            <@includeModel object=exceptionType/>
            <#if exceptionType_has_next>, <#t>
        
    




© 2015 - 2024 Weber Informatics LLC | Privacy Policy