package jetbrains.mps.transformation.test.inputLang.generator.outputLang.template.test_generationScripts; /*Generated by MPS */ import jetbrains.mps.generator.runtime.Generated; import jetbrains.mps.generator.runtime.TemplateDeclarationBase; import jetbrains.mps.generator.runtime.TemplateDeclaration; import org.jetbrains.mps.openapi.model.SNodeReference; import java.util.Collection; import org.jetbrains.mps.openapi.model.SNode; import org.jetbrains.annotations.NotNull; import jetbrains.mps.generator.runtime.TemplateExecutionEnvironment; import jetbrains.mps.generator.runtime.TemplateContext; import jetbrains.mps.generator.runtime.GenerationException; import org.jetbrains.mps.openapi.model.SNodeAccessUtil; import jetbrains.mps.generator.runtime.TemplateUtil; import jetbrains.mps.generator.template.PropertyMacroContext; import jetbrains.mps.generator.template.SourceSubstituteMacroNodesContext; import org.jetbrains.mps.openapi.language.SConcept; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import org.jetbrains.mps.openapi.language.SProperty; import org.jetbrains.mps.openapi.language.SContainmentLink; import jetbrains.mps.smodel.SNodePointer; @Generated public class Template_OutputRoot_by_MappingRule extends TemplateDeclarationBase implements TemplateDeclaration { public Template_OutputRoot_by_MappingRule() { } public SNodeReference getTemplateNode() { return template_5ou570_a0a3; } public Collection<SNode> apply(@NotNull final TemplateExecutionEnvironment environment, @NotNull final TemplateContext context) throws GenerationException { final SNode tnode1 = environment.createOutputNode(myConcepts[0]); try { environment.nodeCopied(context, tnode1, "tpl/r:00000000-0000-4000-0000-011c895905f6/1195168984336"); SNodeAccessUtil.setProperty(tnode1, myProperties[0], "OutputRoot_by_MappingRule"); SNodeAccessUtil.setProperty(tnode1, myProperties[1], TemplateUtil.asString(QueriesGenerated.propertyMacro_GetPropertyValue_1195598330258(new PropertyMacroContext(context, "OutputRoot by MappingRule", propertyMacro_5ou570_c0a0c0c0b0e)))); TemplateContext context1 = context.subContext(); { Collection<SNode> tlist2 = null; final Iterable<SNode> copyListInput2 = QueriesGenerated.sourceNodesQuery_1195170582047(new SourceSubstituteMacroNodesContext(context1, copySrcListMacro_5ou570_b0a0a1a4a1a4)); tlist2 = environment.copyNodes(copyListInput2, copySrcListMacro_5ou570_b0a0a1a4a1a4, "tpl/r:00000000-0000-4000-0000-011c895905f6/1195170418623", context1); for (SNode child3 : TemplateUtil.asNotNull(tlist2)) { tnode1.addChild(myAggregationLinks[0], child3); } // TODO validate child } } finally { } return TemplateUtil.singletonList(tnode1); } @Override protected SConcept[] initConcepts() { SConcept[] rv = new SConcept[1]; rv[0] = MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0x157a9668bf58417bL, 0x893e53d86388dc56L, "jetbrains.mps.transformation.test.outputLang"), 0x116455d922fL, "OutputRoot"); return rv; } @Override protected SProperty[] initProperties() { SProperty[] rv = new SProperty[2]; rv[0] = MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"); rv[1] = MetaAdapterFactory.getProperty(0x157a9668bf58417bL, 0x893e53d86388dc56L, 0x116455d922fL, 0x116455e8bf1L, "text"); return rv; } @Override protected SContainmentLink[] initAggregationLinks() { SContainmentLink[] rv = new SContainmentLink[1]; rv[0] = MetaAdapterFactory.getContainmentLink(0x157a9668bf58417bL, 0x893e53d86388dc56L, 0x116455d922fL, 0x11645a94e4aL, "outputChild"); return rv; } private static SNodePointer template_5ou570_a0a3 = new SNodePointer("r:00000000-0000-4000-0000-011c895905f6(jetbrains.mps.transformation.test.inputLang.generator.outputLang.template.test_generationScripts@generator)", "1195168984336"); private static SNodePointer propertyMacro_5ou570_c0a0c0c0b0e = new SNodePointer("r:00000000-0000-4000-0000-011c895905f6(jetbrains.mps.transformation.test.inputLang.generator.outputLang.template.test_generationScripts@generator)", "1195598330257"); private static SNodePointer copySrcListMacro_5ou570_b0a0a1a4a1a4 = new SNodePointer("r:00000000-0000-4000-0000-011c895905f6(jetbrains.mps.transformation.test.inputLang.generator.outputLang.template.test_generationScripts@generator)", "1195170582046"); }