package jetbrains.mps.lang.editor.forms.generator.template.main; /*Generated by MPS */ import jetbrains.mps.generator.runtime.Generated; import jetbrains.mps.generator.impl.query.QueryProviderBase; import jetbrains.mps.generator.template.BaseMappingRuleContext; import jetbrains.mps.internal.collections.runtime.ListSequence; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import jetbrains.mps.internal.collections.runtime.ITranslator2; import org.jetbrains.mps.openapi.model.SNode; import jetbrains.mps.internal.collections.runtime.IWhereFilter; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SModelOperations; import jetbrains.mps.generator.template.PropertyMacroContext; import jetbrains.mps.generator.template.ReferenceMacroContext; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations; import jetbrains.mps.generator.template.SourceSubstituteMacroNodeContext; import jetbrains.mps.generator.template.SourceSubstituteMacroNodesContext; import jetbrains.mps.generator.template.WeavingMappingRuleContext; import jetbrains.mps.generator.template.MappingScriptContext; import jetbrains.mps.internal.collections.runtime.IVisitor; import jetbrains.mps.smodel.action.SNodeFactoryOperations; import java.util.Map; import jetbrains.mps.generator.impl.query.MapRootRuleCondition; import java.util.HashMap; import org.jetbrains.annotations.NotNull; import jetbrains.mps.generator.impl.query.QueryKey; import jetbrains.mps.generator.template.MapRootRuleContext; import jetbrains.mps.generator.impl.GenerationFailureException; import jetbrains.mps.generator.impl.query.WeaveRuleCondition; import jetbrains.mps.generator.impl.query.WeaveRuleQuery; import jetbrains.mps.generator.impl.query.WeaveAnchorQuery; import org.jetbrains.annotations.Nullable; import jetbrains.mps.generator.template.WeavingAnchorContext; import jetbrains.mps.generator.impl.query.ScriptCodeBlock; import jetbrains.mps.generator.impl.query.SourceNodeQuery; import jetbrains.mps.generator.impl.query.QueryKeyImpl; import jetbrains.mps.generator.impl.query.SourceNodesQuery; import java.util.Collection; import jetbrains.mps.util.IterableUtil; import jetbrains.mps.generator.impl.query.PropertyValueQuery; import org.jetbrains.mps.openapi.language.SProperty; import jetbrains.mps.generator.impl.query.ReferenceTargetQuery; @Generated public class QueriesGenerated extends QueryProviderBase { public QueriesGenerated() { super(1); } public static boolean baseMappingRule_Condition_2597883321844046821(final BaseMappingRuleContext _context) { return ListSequence.fromList(SLinkOperations.getChildren(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xfbc216b31bL, 0x108b65d7766L, "item"))).translate(new ITranslator2<SNode, SNode>() { public Iterable<SNode> translate(SNode it) { return SLinkOperations.getChildren(it, MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x108b5877365L, 0x108b588a8bcL, "keystroke")); } }).where(new IWhereFilter<SNode>() { public boolean accept(SNode it) { return "none".equals(SPropertyOperations.getString(it, MetaAdapterFactory.getProperty(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x108b5885461L, 0x108b5f30aafL, "modifiers"))) && "VK_SPACE".equals(SPropertyOperations.getString(it, MetaAdapterFactory.getProperty(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x108b5885461L, 0x108b5f30ab0L, "keycode"))); } }).isEmpty() && ListSequence.fromList(SModelOperations.nodes(_context.getInputModel(), MetaAdapterFactory.getConcept(0x602c36adcc5547ffL, 0x8c4073d7f12f035cL, 0x455f8dda63d6378L, "jetbrains.mps.lang.editor.forms.structure.CellModel_Checkbox"))).where(new IWhereFilter<SNode>() { public boolean accept(SNode it) { return SLinkOperations.getTarget(it, MetaAdapterFactory.getReferenceLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eafb9a39L, 0xfbc4dbd371L, "keyMap")) == _context.getNode(); } }).isNotEmpty(); } public static boolean baseMappingRule_Condition_2597883321844051449(final BaseMappingRuleContext _context) { return ListSequence.fromList(SLinkOperations.getChildren(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x10951978cfeL, 0x10951978d01L, "item"))).where(new IWhereFilter<SNode>() { public boolean accept(SNode it) { return SPropertyOperations.hasValue(it, MetaAdapterFactory.getProperty(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x109519879e9L, 0x1095198c0daL, "actionId"), "click_action_id", null); } }).isEmpty() && ListSequence.fromList(SModelOperations.nodes(_context.getInputModel(), MetaAdapterFactory.getConcept(0x602c36adcc5547ffL, 0x8c4073d7f12f035cL, 0x455f8dda63d6378L, "jetbrains.mps.lang.editor.forms.structure.CellModel_Checkbox"))).where(new IWhereFilter<SNode>() { public boolean accept(SNode it) { return SLinkOperations.getTarget(it, MetaAdapterFactory.getReferenceLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eafb9a39L, 0x1096ade08ceL, "actionMap")) == _context.getNode(); } }).isNotEmpty(); } public static boolean baseMappingRule_Condition_2597883321844157860(final BaseMappingRuleContext _context) { return ListSequence.fromList(SLinkOperations.getChildren(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eafb9a39L, 0xfbc4dbd371L, "keyMap")), MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xfbc216b31bL, 0x108b65d7766L, "item"))).translate(new ITranslator2<SNode, SNode>() { public Iterable<SNode> translate(SNode it) { return SLinkOperations.getChildren(it, MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x108b5877365L, 0x108b588a8bcL, "keystroke")); } }).where(new IWhereFilter<SNode>() { public boolean accept(SNode it) { return "none".equals(SPropertyOperations.getString(it, MetaAdapterFactory.getProperty(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x108b5885461L, 0x108b5f30aafL, "modifiers"))) && "VK_SPACE".equals(SPropertyOperations.getString(it, MetaAdapterFactory.getProperty(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x108b5885461L, 0x108b5f30ab0L, "keycode"))); } }).isEmpty() || ListSequence.fromList(SLinkOperations.getChildren(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eafb9a39L, 0x1096ade08ceL, "actionMap")), MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x10951978cfeL, 0x10951978d01L, "item"))).where(new IWhereFilter<SNode>() { public boolean accept(SNode it) { return SPropertyOperations.hasValue(it, MetaAdapterFactory.getProperty(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x109519879e9L, 0x1095198c0daL, "actionId"), "click_action_id", null); } }).isEmpty(); } public static Object propertyMacro_GetPropertyValue_3248205251337162387(final PropertyMacroContext _context) { return SPropertyOperations.getString(_context.getNode(), MetaAdapterFactory.getProperty(0x602c36adcc5547ffL, 0x8c4073d7f12f035cL, 0x1298d6f05780e83bL, 0x1298d6f05780e83eL, "trueText")); } public static Object propertyMacro_GetPropertyValue_3248205251337162527(final PropertyMacroContext _context) { return SPropertyOperations.getString(_context.getNode(), MetaAdapterFactory.getProperty(0x602c36adcc5547ffL, 0x8c4073d7f12f035cL, 0x1298d6f05780e83bL, 0x1298d6f05780e840L, "falseText")); } public static Object propertyMacro_GetPropertyValue_1801654740563707790(final PropertyMacroContext _context) { return _context.createUniqueName("ToggleCheckboxAction", _context.getNode()); } public static Object referenceMacro_GetReferent_8215612579904436705(final ReferenceMacroContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x132a500f473d6174L, 0x132a500f473d9055L, "parentStyleClass")); } public static Object referenceMacro_GetReferent_2597883321844201465(final ReferenceMacroContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eafb9a39L, 0x1096ade08ceL, "actionMap")); } public static Object referenceMacro_GetReferent_2597883321844202346(final ReferenceMacroContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eafb9a39L, 0xfbc4dbd371L, "keyMap")); } public static Object referenceMacro_GetReferent_4319657350470163594(final ReferenceMacroContext _context) { return SLinkOperations.getTarget(SNodeOperations.getNodeAncestor(_context.getNode(), MetaAdapterFactory.getConcept(0x602c36adcc5547ffL, 0x8c4073d7f12f035cL, 0x455f8dda63d6378L, "jetbrains.mps.lang.editor.forms.structure.CellModel_Checkbox"), false, false), MetaAdapterFactory.getReferenceLink(0x602c36adcc5547ffL, 0x8c4073d7f12f035cL, 0x455f8dda63d6378L, 0x334adf8cb15f3fdfL, "propertyDeclaration")); } public static Object referenceMacro_GetReferent_8215612579904436045(final ReferenceMacroContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x132a500f473d6174L, 0x132a500f473d9055L, "parentStyleClass")); } public static Object referenceMacro_GetReferent_7024409093146625667(final ReferenceMacroContext _context) { return SLinkOperations.getTarget(SNodeOperations.getNodeAncestor(_context.getNode(), MetaAdapterFactory.getConcept(0x602c36adcc5547ffL, 0x8c4073d7f12f035cL, 0x455f8dda63d6378L, "jetbrains.mps.lang.editor.forms.structure.CellModel_Checkbox"), false, false), MetaAdapterFactory.getReferenceLink(0x602c36adcc5547ffL, 0x8c4073d7f12f035cL, 0x455f8dda63d6378L, 0x334adf8cb15f3fdfL, "propertyDeclaration")); } public static Object referenceMacro_GetReferent_7024409093146625686(final ReferenceMacroContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x132a500f473d6174L, 0x132a500f473d9055L, "parentStyleClass")); } public static Object referenceMacro_GetReferent_2597883321844426009(final ReferenceMacroContext _context) { return (SNode) SNodeOperations.getParent(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x602c36adcc5547ffL, 0x8c4073d7f12f035cL, 0x455f8dda63d6378L, 0x334adf8cb15f3fdfL, "propertyDeclaration"))); } public static Object referenceMacro_GetReferent_1801654740563739441(final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "actionClassConstructor"); } public static Object referenceMacro_GetReferent_1801654740563725845(final ReferenceMacroContext _context) { return (SNode) SNodeOperations.getParent(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x602c36adcc5547ffL, 0x8c4073d7f12f035cL, 0x455f8dda63d6378L, 0x334adf8cb15f3fdfL, "propertyDeclaration"))); } public static Object referenceMacro_GetReferent_1801654740563717866(final ReferenceMacroContext _context) { return (SNode) SNodeOperations.getParent(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x602c36adcc5547ffL, 0x8c4073d7f12f035cL, 0x455f8dda63d6378L, 0x334adf8cb15f3fdfL, "propertyDeclaration"))); } public static Object referenceMacro_GetReferent_1801654740563710767(final ReferenceMacroContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x602c36adcc5547ffL, 0x8c4073d7f12f035cL, 0x455f8dda63d6378L, 0x334adf8cb15f3fdfL, "propertyDeclaration")); } public static Object referenceMacro_GetReferent_1801654740563710777(final ReferenceMacroContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x602c36adcc5547ffL, 0x8c4073d7f12f035cL, 0x455f8dda63d6378L, 0x334adf8cb15f3fdfL, "propertyDeclaration")); } public static SNode sourceNodeQuery_8215612579904199776(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x602c36adcc5547ffL, 0x8c4073d7f12f035cL, 0x455f8dda63d6378L, 0x1298d6f05780ea9aL, "ui")); } public static SNode sourceNodeQuery_8215612579904199394(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x602c36adcc5547ffL, 0x8c4073d7f12f035cL, 0x455f8dda63d6378L, 0x7203b81cfd6af4e6L, "label")); } public static SNode sourceNodeQuery_4682006100572905480(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x602c36adcc5547ffL, 0x8c4073d7f12f035cL, 0x455f8dda63d6378L, 0x1298d6f05780ea9aL, "ui")); } public static SNode sourceNodeQuery_2597883321844336452(final SourceSubstituteMacroNodeContext _context) { return ListSequence.fromList(SModelOperations.nodes(_context.getInputModel(), MetaAdapterFactory.getConcept(0x602c36adcc5547ffL, 0x8c4073d7f12f035cL, 0x455f8dda63d6378L, "jetbrains.mps.lang.editor.forms.structure.CellModel_Checkbox"))).where(new IWhereFilter<SNode>() { public boolean accept(SNode it) { return SLinkOperations.getTarget(it, MetaAdapterFactory.getReferenceLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eafb9a39L, 0xfbc4dbd371L, "keyMap")) == _context.getNode(); } }).first(); } public static SNode sourceNodeQuery_2597883321844374983(final SourceSubstituteMacroNodeContext _context) { return ListSequence.fromList(SModelOperations.nodes(_context.getInputModel(), MetaAdapterFactory.getConcept(0x602c36adcc5547ffL, 0x8c4073d7f12f035cL, 0x455f8dda63d6378L, "jetbrains.mps.lang.editor.forms.structure.CellModel_Checkbox"))).where(new IWhereFilter<SNode>() { public boolean accept(SNode it) { return SLinkOperations.getTarget(it, MetaAdapterFactory.getReferenceLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eafb9a39L, 0x1096ade08ceL, "actionMap")) == _context.getNode(); } }).first(); } public static Iterable<SNode> sourceNodesQuery_8215612579904203781(final SourceSubstituteMacroNodesContext _context) { return SLinkOperations.getChildren(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x11beb039542L, 0x11beb040d06L, "styleItem")); } public static Iterable<SNode> sourceNodesQuery_8215612579904434461(final SourceSubstituteMacroNodesContext _context) { return SLinkOperations.getChildren(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x11beb039542L, 0x11beb040d06L, "styleItem")); } public static Iterable<SNode> sourceNodesQuery_7024409093146625694(final SourceSubstituteMacroNodesContext _context) { return SLinkOperations.getChildren(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x11beb039542L, 0x11beb040d06L, "styleItem")); } public static SNode weaving_MappingRule_ContextNodeQuery_2597883321844046124(final WeavingMappingRuleContext _context) { return _context.getCopiedOutputNodeForInputNode(_context.getNode()); } public static SNode weaving_MappingRule_ContextNodeQuery_2597883321844050704(final WeavingMappingRuleContext _context) { return _context.getCopiedOutputNodeForInputNode(_context.getNode()); } public static void mappingScript_CodeBlock_4682006100573072638(final MappingScriptContext _context) { ListSequence.fromList(SModelOperations.nodes(_context.getModel(), MetaAdapterFactory.getConcept(0x602c36adcc5547ffL, 0x8c4073d7f12f035cL, 0x455f8dda63d6378L, "jetbrains.mps.lang.editor.forms.structure.CellModel_Checkbox"))).where(new IWhereFilter<SNode>() { public boolean accept(SNode it) { return SLinkOperations.getTarget(it, MetaAdapterFactory.getReferenceLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eafb9a39L, 0x1096ade08ceL, "actionMap")) == null; } }).visitAll(new IVisitor<SNode>() { public void visit(SNode it) { SNode emptyActionMap = SNodeFactoryOperations.createNewNode(_context.getModel(), SNodeFactoryOperations.asInstanceConcept(MetaAdapterFactory.getConcept(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0x10951978cfeL, "jetbrains.mps.lang.editor.structure.CellActionMapDeclaration")), null); SPropertyOperations.set(emptyActionMap, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), _context.createUniqueName("Checkbox_ActionMap", null)); SModelOperations.addRootNode(_context.getModel(), emptyActionMap); SLinkOperations.setTarget(it, MetaAdapterFactory.getReferenceLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eafb9a39L, 0x1096ade08ceL, "actionMap"), emptyActionMap); } }); ListSequence.fromList(SModelOperations.nodes(_context.getModel(), MetaAdapterFactory.getConcept(0x602c36adcc5547ffL, 0x8c4073d7f12f035cL, 0x455f8dda63d6378L, "jetbrains.mps.lang.editor.forms.structure.CellModel_Checkbox"))).where(new IWhereFilter<SNode>() { public boolean accept(SNode it) { return SLinkOperations.getTarget(it, MetaAdapterFactory.getReferenceLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eafb9a39L, 0xfbc4dbd371L, "keyMap")) == null; } }).visitAll(new IVisitor<SNode>() { public void visit(SNode it) { SNode emptyKeyMap = SNodeFactoryOperations.createNewNode(_context.getModel(), SNodeFactoryOperations.asInstanceConcept(MetaAdapterFactory.getConcept(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xfbc216b31bL, "jetbrains.mps.lang.editor.structure.CellKeyMapDeclaration")), null); SPropertyOperations.set(emptyKeyMap, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), _context.createUniqueName("Checkbox_KeyMap", null)); SModelOperations.addRootNode(_context.getModel(), emptyKeyMap); SLinkOperations.setTarget(it, MetaAdapterFactory.getReferenceLink(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eafb9a39L, 0xfbc4dbd371L, "keyMap"), emptyKeyMap); } }); } private final Map<String, MapRootRuleCondition> mrrcMethods = new HashMap<String, MapRootRuleCondition>(); { int i = 0; mrrcMethods.put("1801654740563814042", new QueriesGenerated.MRRC(i++)); } @Override @NotNull public MapRootRuleCondition getMapRootRuleCondition(@NotNull QueryKey identity) { final String id = identity.getTemplateNode().getNodeId().toString(); if (!(mrrcMethods.containsKey(id))) { return super.getMapRootRuleCondition(identity); } return mrrcMethods.get(id); } private static class MRRC implements MapRootRuleCondition { private final int methodKey; public MRRC(int methodKey) { this.methodKey = methodKey; } @Override public boolean check(@NotNull MapRootRuleContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return QueriesGenerated.baseMappingRule_Condition_2597883321844157860(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no condition method for rule %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } } private final Map<String, QueriesGenerated.WRQ> wrcnMethods = new HashMap<String, QueriesGenerated.WRQ>(); { int i = 0; wrcnMethods.put("2597883321844046123", new QueriesGenerated.WRQ(i++)); wrcnMethods.put("2597883321844050703", new QueriesGenerated.WRQ(i++)); } @Override @NotNull public WeaveRuleCondition getWeaveRuleCondition(@NotNull QueryKey identity) { final String id = identity.getTemplateNode().getNodeId().toString(); if (!(wrcnMethods.containsKey(id))) { return super.getWeaveRuleCondition(identity); } return wrcnMethods.get(id); } @Override @NotNull public WeaveRuleQuery getWeaveRuleQuery(@NotNull QueryKey identity) { final String id = identity.getTemplateNode().getNodeId().toString(); if (!(wrcnMethods.containsKey(id))) { return super.getWeaveRuleQuery(identity); } return wrcnMethods.get(id); } @NotNull @Override public WeaveAnchorQuery getWeaveAnchorQuery(@NotNull QueryKey identity) { final String id = identity.getTemplateNode().getNodeId().toString(); if (!(wrcnMethods.containsKey(id))) { return super.getWeaveAnchorQuery(identity); } return wrcnMethods.get(id); } private static class WRQ implements WeaveRuleQuery, WeaveRuleCondition, WeaveAnchorQuery { private final int methodKey; public WRQ(int methodKey) { this.methodKey = methodKey; } @Override public boolean check(@NotNull WeavingMappingRuleContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return QueriesGenerated.baseMappingRule_Condition_2597883321844046821(ctx); case 1: return QueriesGenerated.baseMappingRule_Condition_2597883321844051449(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no condition method for rule %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } @Override public SNode contextNode(WeavingMappingRuleContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return QueriesGenerated.weaving_MappingRule_ContextNodeQuery_2597883321844046124(ctx); case 1: return QueriesGenerated.weaving_MappingRule_ContextNodeQuery_2597883321844050704(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no context node query method for weaving rule %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } @Nullable @Override public SNode anchorNode(WeavingAnchorContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return null; case 1: return null; default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no anchor query method for rule %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } } private final Map<String, ScriptCodeBlock> mscbMethods = new HashMap<String, ScriptCodeBlock>(); { int i = 0; mscbMethods.put("4682006100573072637", new QueriesGenerated.SCB(i++)); } @Override @NotNull public ScriptCodeBlock getScriptCodeBlock(@NotNull QueryKey identity) { final String id = identity.getTemplateNode().getNodeId().toString(); if (!(mscbMethods.containsKey(id))) { return super.getScriptCodeBlock(identity); } return mscbMethods.get(id); } private static class SCB implements ScriptCodeBlock { private final int methodKey; public SCB(int methodKey) { this.methodKey = methodKey; } @Override public void invoke(MappingScriptContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: QueriesGenerated.mappingScript_CodeBlock_4682006100573072638(ctx); return; default: throw new GenerationFailureException(String.format("There's no code block with method index %d ", methodKey)); } } } private final Map<String, SourceNodeQuery> snqMethods = new HashMap<String, SourceNodeQuery>(); { int i = 0; snqMethods.put("8215612579904199776", new QueriesGenerated.SNQ(i++)); snqMethods.put("8215612579904199394", new QueriesGenerated.SNQ(i++)); snqMethods.put("4682006100572905480", new QueriesGenerated.SNQ(i++)); snqMethods.put("2597883321844336452", new QueriesGenerated.SNQ(i++)); snqMethods.put("2597883321844374983", new QueriesGenerated.SNQ(i++)); } @NotNull @Override public SourceNodeQuery getSourceNodeQuery(@NotNull QueryKey identity) { final String id = ((QueryKeyImpl) identity).getQueryNodeId().toString(); if (!(snqMethods.containsKey(id))) { return super.getSourceNodeQuery(identity); } return snqMethods.get(id); } private static class SNQ implements SourceNodeQuery { private final int methodKey; public SNQ(int methodKey) { this.methodKey = methodKey; } @Nullable public SNode evaluate(@NotNull SourceSubstituteMacroNodeContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return QueriesGenerated.sourceNodeQuery_8215612579904199776(ctx); case 1: return QueriesGenerated.sourceNodeQuery_8215612579904199394(ctx); case 2: return QueriesGenerated.sourceNodeQuery_4682006100572905480(ctx); case 3: return QueriesGenerated.sourceNodeQuery_2597883321844336452(ctx); case 4: return QueriesGenerated.sourceNodeQuery_2597883321844374983(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } } private final Map<String, SourceNodesQuery> snsqMethods = new HashMap<String, SourceNodesQuery>(); { int i = 0; snsqMethods.put("8215612579904203781", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("8215612579904434461", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("7024409093146625694", new QueriesGenerated.SNsQ(i++)); } @NotNull @Override public SourceNodesQuery getSourceNodesQuery(@NotNull QueryKey identity) { final String id = ((QueryKeyImpl) identity).getQueryNodeId().toString(); if (!(snsqMethods.containsKey(id))) { return super.getSourceNodesQuery(identity); } return snsqMethods.get(id); } private static class SNsQ implements SourceNodesQuery { private final int methodKey; public SNsQ(int methodKey) { this.methodKey = methodKey; } @NotNull public Collection<SNode> evaluate(@NotNull SourceSubstituteMacroNodesContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_8215612579904203781(ctx)); case 1: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_8215612579904434461(ctx)); case 2: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_7024409093146625694(ctx)); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } } private final Map<String, PropertyValueQuery> pvqMethods = new HashMap<String, PropertyValueQuery>(); { int i = 0; pvqMethods.put("3248205251337162384", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eb01232eL, 0xf9eb01232fL, "text"), "x")); pvqMethods.put("3248205251337162524", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0x18bc659203a64e29L, 0xa83a7ff23bde13baL, 0xf9eb01232eL, 0xf9eb01232fL, "text"), " ")); pvqMethods.put("1801654740563707789", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "ToggleCheckboxAction")); } @NotNull @Override public PropertyValueQuery getPropertyValueQuery(@NotNull QueryKey identity) { final String id = identity.getTemplateNode().getNodeId().toString(); if (!(pvqMethods.containsKey(id))) { return super.getPropertyValueQuery(identity); } return pvqMethods.get(id); } private static class PVQ extends PropertyValueQuery.Base { private final int methodKey; /*package*/ PVQ(int methodKey, SProperty property, String templateValue) { super(property, templateValue); this.methodKey = methodKey; } @Nullable public Object evaluate(@NotNull PropertyMacroContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return QueriesGenerated.propertyMacro_GetPropertyValue_3248205251337162387(ctx); case 1: return QueriesGenerated.propertyMacro_GetPropertyValue_3248205251337162527(ctx); case 2: return QueriesGenerated.propertyMacro_GetPropertyValue_1801654740563707790(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } } private final Map<String, ReferenceTargetQuery> rtqMethods = new HashMap<String, ReferenceTargetQuery>(); { rtqMethods.put("8215612579904436702", new QueriesGenerated.RTQ(0, null)); rtqMethods.put("2597883321844201464", new QueriesGenerated.RTQ(1, null)); rtqMethods.put("2597883321844202345", new QueriesGenerated.RTQ(2, null)); rtqMethods.put("4319657350470163593", new QueriesGenerated.RTQ(3, "alias")); rtqMethods.put("8215612579904436042", new QueriesGenerated.RTQ(4, null)); rtqMethods.put("7024409093146625666", new QueriesGenerated.RTQ(5, "alias")); rtqMethods.put("7024409093146625685", new QueriesGenerated.RTQ(6, null)); rtqMethods.put("2597883321844426008", new QueriesGenerated.RTQ(7, "ClassConcept")); rtqMethods.put("1801654740563739440", new QueriesGenerated.RTQ(8, "ToggleCheckboxAction")); rtqMethods.put("1801654740563725844", new QueriesGenerated.RTQ(9, "ClassConcept")); rtqMethods.put("1801654740563717865", new QueriesGenerated.RTQ(10, "ClassConcept")); rtqMethods.put("1801654740563710766", new QueriesGenerated.RTQ(11, "abstractClass")); rtqMethods.put("1801654740563710776", new QueriesGenerated.RTQ(12, "abstractClass")); } @NotNull @Override public ReferenceTargetQuery getReferenceTargetQuery(@NotNull QueryKey queryKey) { final String id = queryKey.getTemplateNode().getNodeId().toString(); if (!(rtqMethods.containsKey(id))) { return super.getReferenceTargetQuery(queryKey); } return rtqMethods.get(id); } private static class RTQ extends ReferenceTargetQuery.Base { private final int methodKey; /*package*/ RTQ(int methodKey, String templateValue) { super(templateValue); this.methodKey = methodKey; } @Nullable public Object evaluate(@NotNull ReferenceMacroContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return QueriesGenerated.referenceMacro_GetReferent_8215612579904436705(ctx); case 1: return QueriesGenerated.referenceMacro_GetReferent_2597883321844201465(ctx); case 2: return QueriesGenerated.referenceMacro_GetReferent_2597883321844202346(ctx); case 3: return QueriesGenerated.referenceMacro_GetReferent_4319657350470163594(ctx); case 4: return QueriesGenerated.referenceMacro_GetReferent_8215612579904436045(ctx); case 5: return QueriesGenerated.referenceMacro_GetReferent_7024409093146625667(ctx); case 6: return QueriesGenerated.referenceMacro_GetReferent_7024409093146625686(ctx); case 7: return QueriesGenerated.referenceMacro_GetReferent_2597883321844426009(ctx); case 8: return QueriesGenerated.referenceMacro_GetReferent_1801654740563739441(ctx); case 9: return QueriesGenerated.referenceMacro_GetReferent_1801654740563725845(ctx); case 10: return QueriesGenerated.referenceMacro_GetReferent_1801654740563717866(ctx); case 11: return QueriesGenerated.referenceMacro_GetReferent_1801654740563710767(ctx); case 12: return QueriesGenerated.referenceMacro_GetReferent_1801654740563710777(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } } }