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

templates.ContainedElementsMethod.vm Maven / Gradle / Ivy

There is a newer version: 3.5.12
Show newest version
#* @vtlvariable name="currentClass" type="org.eclipse.emf.ecore.EClass" *#
#* @vtlvariable name="FQNHelper" type="org.kevoree.modeling.kotlin.generator.ProcessorHelper" *#
#* @vtlvariable name="ctx" type="org.kevoree.modeling.kotlin.generator.GenerationContext" *#
#* @vtlvariable name="packElem" type="java.lang.String" *#

#if($ctx.jS)
    #set($mutableOrNot="")
#else
    #set($mutableOrNot="Mutable")

override fun containedAllElements() : ${mutableOrNot}Iterable<$ctx.getKevoreeContainer().get()> {
return ${packElem}.DeepIterable(this)
}

override fun containedElements() : ${mutableOrNot}Iterable<$ctx.getKevoreeContainer().get()> {
    return ${packElem}.CompositeIterable(containedElementsList())
}

#end

override fun containedElementsList() : MutableList {

    val result = java.util.ArrayList($currentClass.getEAllContainments().size())
#set($i=0)
#foreach( $ref in $currentClass.getEAllContainments())
    #if($ref.isMany())
        #if(${ref.getEReferenceType().getEIDAttribute()})
        result.addAll(_${ref.getName()}.values())
        #else
        result.addAll(_${ref.getName()})
        #end
    #else
        if(_${ref.getName()}!=null){result.add(_${ref.getName()}!!)}
    #end
    #set($i=$i+1)
#end
    return result
}







© 2015 - 2025 Weber Informatics LLC | Privacy Policy