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

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

<#--

    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.presenceChecker?? >
    if ( <#if entry_index != 0>${entry.previousPropertyName} == null || !<@includeModel object=entry.presenceChecker /> ) {
        return ${returnType.null};
    }
    
    <@includeModel object=entry.type.typeBound/> ${entry.name} = ${entry.previousPropertyName}.${entry.accessorName};
    <#if !entry.presenceChecker?? >
    <#if !entry.type.primitive>
    if ( ${entry.name} == null ) {
        return ${returnType.null};
    }
    
    
    <#if !entry_has_next>
    return ${entry.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