templates.commands.XMIResolveCommand.vm Maven / Gradle / Ivy
#* @vtlvariable name="ctx" type="org.kevoree.modeling.kotlin.generator.GenerationContext" *#
#* @vtlvariable name="helper" type="org.kevoree.modeling.kotlin.generator.ProcessorHelperClass" *#
package ${helper.fqn($ctx, $ctx.getBasePackageForUtilitiesGeneration())}.loader
public class XMIResolveCommand(val context : LoadingContext, val target : org.kevoree.modeling.api.KMFContainer, val mutatorType : Int, val refName : String, val ref : String) : ResolveCommand {
override fun run() {
var referencedElement = context.map.get(ref)
if(referencedElement != null) {
target.reflexiveMutator(mutatorType,refName, referencedElement)
return
}
if(ref.equals("/0/") || ref.equals("/")) {
referencedElement = context.map.get("/0")
if(referencedElement != null) {
target.reflexiveMutator(mutatorType,refName, referencedElement)
return
}
}
throw Exception("KMF Load error : reference " + ref + " not found in map when trying to " + mutatorType + " "+refName+" on " + target.toString())
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy