package jetbrains.mps.lang.findUsages.generator.baseLanguage.template.main; /*Generated by MPS */ import jetbrains.mps.generator.runtime.Generated; import jetbrains.mps.generator.impl.query.QueryProviderBase; import jetbrains.mps.generator.template.CreateRootRuleContext; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SModuleOperations; import jetbrains.mps.generator.template.BaseMappingRuleContext; import org.jetbrains.mps.openapi.model.SModel; import jetbrains.mps.generator.template.PropertyMacroContext; import jetbrains.mps.lang.findUsages.behavior.FinderDeclaration__BehaviorDescriptor; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations; import jetbrains.mps.internal.collections.runtime.ListSequence; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations; import org.jetbrains.mps.openapi.language.SAbstractConcept; import jetbrains.mps.textgen.trace.TracingUtil; import org.jetbrains.mps.openapi.model.SNode; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SModelOperations; import jetbrains.mps.util.NameUtil; import jetbrains.mps.generator.template.ReferenceMacroContext; import jetbrains.mps.generator.template.IfMacroContext; import jetbrains.mps.generator.template.SourceSubstituteMacroNodeContext; import jetbrains.mps.generator.template.SourceSubstituteMacroNodesContext; import java.util.List; import jetbrains.mps.generator.template.TemplateVarContext; import jetbrains.mps.internal.collections.runtime.ISelector; import java.util.Map; import jetbrains.mps.generator.impl.query.ReductionRuleCondition; import java.util.HashMap; import org.jetbrains.annotations.NotNull; import jetbrains.mps.generator.impl.query.QueryKey; import jetbrains.mps.generator.template.ReductionRuleQueryContext; import jetbrains.mps.generator.impl.GenerationFailureException; import jetbrains.mps.generator.impl.query.CreateRootCondition; import jetbrains.mps.generator.impl.query.SourceNodeQuery; import jetbrains.mps.generator.impl.query.QueryKeyImpl; import org.jetbrains.annotations.Nullable; 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.IfMacroCondition; import jetbrains.mps.generator.impl.query.ReferenceTargetQuery; import jetbrains.mps.generator.impl.query.VariableValueQuery; @Generated public class QueriesGenerated extends QueryProviderBase { public QueriesGenerated() { super(1); } public static boolean createRootRule_Condition_7991477654791680147(final CreateRootRuleContext _context) { // see MPS-24613 return SModuleOperations.isAspect(_context.getOriginalInputModel(), "findUsages"); } public static boolean baseMappingRule_Condition_1570228009929814973(final BaseMappingRuleContext _context) { // see MPS-24613 return SModuleOperations.isAspect(((SModel) _context.getVariable("model")), "findUsages"); } public static Object propertyMacro_GetPropertyValue_4192433084863763942(final PropertyMacroContext _context) { return (String) FinderDeclaration__BehaviorDescriptor.getGeneratedClassLongName_idhEwIc4S.invoke(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x1bd5a514384e195fL, 0x643a39f7c0869a50L, "finder"))); } public static Object propertyMacro_GetPropertyValue_7518998791520133701(final PropertyMacroContext _context) { return (String) FinderDeclaration__BehaviorDescriptor.getGeneratedClassLongName_idhEwIc4S.invoke(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x1bd5a514384e195fL, 0x643a39f7c0869a50L, "finder"))); } public static Object propertyMacro_GetPropertyValue_7518998791520106752(final PropertyMacroContext _context) { return (String) FinderDeclaration__BehaviorDescriptor.getGeneratedClassLongName_idhEwIc4S.invoke(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x1bd5a514384e195fL, 0x643a39f7c0869a50L, "finder"))); } public static Object propertyMacro_GetPropertyValue_1197207280707(final PropertyMacroContext _context) { return (String) FinderDeclaration__BehaviorDescriptor.getGeneratedClassName_idhEwIc4_.invoke(_context.getNode()); } public static Object propertyMacro_GetPropertyValue_1202839664536(final PropertyMacroContext _context) { return SPropertyOperations.getString(_context.getNode(), MetaAdapterFactory.getProperty(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x116b5695a8dL, 0x116c9c44c38L, "description")); } public static Object propertyMacro_GetPropertyValue_1202839710232(final PropertyMacroContext _context) { return SPropertyOperations.getString(_context.getNode(), MetaAdapterFactory.getProperty(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x116b5695a8dL, 0x1180ec04907L, "longDescription")); } public static Object propertyMacro_GetPropertyValue_7810572934689530075(final PropertyMacroContext _context) { return ListSequence.fromList(SNodeOperations.getNodeDescendants(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x11bd0c17f12L, 0x11bd0c21635L, "findFunction")), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x108bbca0f48L, 0x108bbd29b4aL, "body")), MetaAdapterFactory.getConcept(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x118d6fce801L, "jetbrains.mps.lang.findUsages.structure.ExecuteFinderExpression"), false, new SAbstractConcept[]{})).count(); } public static Object propertyMacro_GetPropertyValue_5697304327500975268(final PropertyMacroContext _context) { return TracingUtil.getInput(_context.getNode()).getNodeId().toString(); } public static Object propertyMacro_GetPropertyValue_5097877160789321859(final PropertyMacroContext _context) { return (String) FinderDeclaration__BehaviorDescriptor.getGeneratedClassLongName_idhEwIc4S.invoke(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x118d6fce801L, 0x118d6fce808L, "finder"))); } public static Object propertyMacro_GetPropertyValue_5697304327500755469(final PropertyMacroContext _context) { return _context.getOriginalInputModel().getReference().toString(); } public static Object propertyMacro_GetPropertyValue_7991477654791693978(final PropertyMacroContext _context) { SNode module = SModelOperations.getModuleStub(_context.getOriginalInputModel()); assert SNodeOperations.isInstanceOf(module, MetaAdapterFactory.getConcept(0x86ef829012bb4ca7L, 0x947f093788f263a9L, 0x5869770da61dfe1fL, "jetbrains.mps.lang.project.structure.Language")); return "FindUsagesDescriptor"; } public static Object propertyMacro_GetPropertyValue_5697304327501139696(final PropertyMacroContext _context) { return ((Integer) _context.getVariable("cv:c")); } public static Object propertyMacro_GetPropertyValue_5697304327501150549(final PropertyMacroContext _context) { return ((Integer) _context.getVariable("cv:c")); } public static Object propertyMacro_GetPropertyValue_5697304327501193998(final PropertyMacroContext _context) { return NameUtil.toValidIdentifier(SPropertyOperations.getString(_context.getNode(), MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"))); } public static Object referenceMacro_GetReferent_8928180329700848724(final ReferenceMacroContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x11bd0c17f12L, 0x11bd0c2f241L, "forConcept")); } public static Object referenceMacro_GetReferent_5697304327501162560(final ReferenceMacroContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x11bd0c17f12L, 0x11bd0c2f241L, "forConcept")); } public static Object referenceMacro_GetReferent_4147950839246952264(final ReferenceMacroContext _context) { // TODO genContext.get output FindUsagesDescriptorCons for model model; return SModelOperations.getModelName(((SModel) _context.getVariable("model"))) + ".FindUsagesDescriptor"; } public static boolean ifMacro_Condition_4192433084863763888(final IfMacroContext _context) { return (SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x1bd5a514384e1959L, 0x585a05e7f4113540L, "progress")) != null); } public static boolean ifMacro_Condition_4192433084863763916(final IfMacroContext _context) { return (SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x1bd5a514384e1959L, 0x585a05e7f411353fL, "scope")) != null); } public static boolean ifMacro_Condition_1216396960791(final IfMacroContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x116b5695a8dL, 0x11b36e6cbecL, "isVisibleBlock")) != null; } public static boolean ifMacro_Condition_6297023828538094163(final IfMacroContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x116b5695a8dL, 0x11b36e6cbecL, "isVisibleBlock")) != null; } public static boolean ifMacro_Condition_100784871543542637(final IfMacroContext _context) { return (SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x116b5695a8dL, 0x1660f4e8320e447L, "isUsedByDefault")) != null); } public static boolean ifMacro_Condition_1216397265033(final IfMacroContext _context) { return SPropertyOperations.getString(_context.getNode(), MetaAdapterFactory.getProperty(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x116b5695a8dL, 0x116c9c44c38L, "description")) != null && !(SPropertyOperations.getString(_context.getNode(), MetaAdapterFactory.getProperty(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x116b5695a8dL, 0x116c9c44c38L, "description")).equals("")); } public static boolean ifMacro_Condition_1216397326228(final IfMacroContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x11bd0c17f12L, 0x11bd0c21634L, "isApplicableFunction")) != null; } public static boolean ifMacro_Condition_8441762775552326216(final IfMacroContext _context) { return ListSequence.fromList(SNodeOperations.getNodeDescendants(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x11bd0c17f12L, 0x11bd0c21635L, "findFunction")), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x108bbca0f48L, 0x108bbd29b4aL, "body")), MetaAdapterFactory.getConcept(0x13744753c81f424aL, 0x9c1bcf8943bf4e86L, 0x7be6ee9831c8594L, "jetbrains.mps.lang.sharedConcepts.structure.ConceptFunctionParameter_progressMonitor"), false, new SAbstractConcept[]{})).isEmpty(); } public static boolean ifMacro_Condition_1218978335315(final IfMacroContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x11bd0c17f12L, 0x11bd0c21636L, "searchedNodesBlock")) != null; } public static boolean ifMacro_Condition_1216397346723(final IfMacroContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x11bd0c17f12L, 0x11bd0c21637L, "categorizeBlock")) != null; } public static boolean ifMacro_Condition_5697304327500936395(final IfMacroContext _context) { return TracingUtil.getInput(_context.getNode()) != null; } public static boolean ifMacro_Condition_5097877160789322145(final IfMacroContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x118d6fce801L, 0x118d6fce805L, "queryScope")) == null; } public static boolean ifMacro_Condition_5097877160789322167(final IfMacroContext _context) { SNode ancestor = SNodeOperations.getNodeAncestor(_context.getNode(), MetaAdapterFactory.getConcept(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x116b5695a88L, "jetbrains.mps.lang.findUsages.structure.FindBlock"), false, false); return ancestor != null && ((SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x118d6fce801L, 0x75272a849af7fedfL, "monitor")) != null) || ListSequence.fromList(SNodeOperations.getNodeDescendants(SLinkOperations.getTarget(ancestor, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x108bbca0f48L, 0x108bbd29b4aL, "body")), MetaAdapterFactory.getConcept(0x13744753c81f424aL, 0x9c1bcf8943bf4e86L, 0x7be6ee9831c8594L, "jetbrains.mps.lang.sharedConcepts.structure.ConceptFunctionParameter_progressMonitor"), false, new SAbstractConcept[]{})).isEmpty()); } public static boolean ifMacro_Condition_5097877160789322202(final IfMacroContext _context) { return (SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x118d6fce801L, 0x75272a849af7fedfL, "monitor")) == null); } public static SNode sourceNodeQuery_4192433084863763900(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x1bd5a514384e1959L, 0x585a05e7f4113540L, "progress")); } public static SNode sourceNodeQuery_4192433084863763908(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x1bd5a514384e1959L, 0x585a05e7f411353eL, "queryNode")); } public static SNode sourceNodeQuery_4192433084863763927(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x1bd5a514384e1959L, 0x585a05e7f411353fL, "scope")); } public static SNode sourceNodeQuery_6818267381900889431(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x5e9f5a0f21d59aacL, 0x5e9f5a0f21d59aadL, "finder")); } public static SNode sourceNodeQuery_1216396990767(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x116b5695a8dL, 0x11b36e6cbecL, "isVisibleBlock")), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x108bbca0f48L, 0x108bbd29b4aL, "body")); } public static SNode sourceNodeQuery_100784871586267457(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x116b5695a8dL, 0x1660f4e8320e447L, "isUsedByDefault")), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x108bbca0f48L, 0x108bbd29b4aL, "body")); } public static SNode sourceNodeQuery_1197207280679(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x11bd0c17f12L, 0x11bd0c21634L, "isApplicableFunction")), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x108bbca0f48L, 0x108bbd29b4aL, "body")); } public static SNode sourceNodeQuery_1206533715312(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x11bd0c17f12L, 0x11bd0c21635L, "findFunction")), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x108bbca0f48L, 0x108bbd29b4aL, "body")); } public static SNode sourceNodeQuery_1206533783913(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x11bd0c17f12L, 0x11bd0c21636L, "searchedNodesBlock")), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x108bbca0f48L, 0x108bbd29b4aL, "body")); } public static SNode sourceNodeQuery_1206462965299(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x11bd0c17f12L, 0x11bd0c21637L, "categorizeBlock")), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x108bbca0f48L, 0x108bbd29b4aL, "body")); } public static SNode sourceNodeQuery_1206533809816(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x1177408145aL, 0x11774086327L, "foundNode")); } public static SNode sourceNodeQuery_1206533844017(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x1177404a3f4L, 0x117740540a3L, "foundNode")); } public static SNode sourceNodeQuery_5097877160789322137(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x118d6fce801L, 0x118d6fce804L, "queryNode")); } public static SNode sourceNodeQuery_5097877160789322156(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x118d6fce801L, 0x118d6fce805L, "queryScope")); } public static SNode sourceNodeQuery_5097877160789322213(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x118d6fce801L, 0x75272a849af7fedfL, "monitor")); } public static Iterable<SNode> sourceNodesQuery_4192433084863763935(final SourceSubstituteMacroNodesContext _context) { return SLinkOperations.getChildren(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x1bd5a514384e1959L, 0x711c6afd1909d279L, "finder")); } public static Iterable<SNode> sourceNodesQuery_7518998791520133710(final SourceSubstituteMacroNodesContext _context) { return SLinkOperations.getChildren(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x585a05e7f40a28d1L, 0x585a05e7f40a28d2L, "finder")); } public static Iterable<SNode> sourceNodesQuery_5697304327501119908(final SourceSubstituteMacroNodesContext _context) { return ((List<SNode>) _context.getVariable("var:sortedDecl")); } public static Iterable<SNode> sourceNodesQuery_5697304327500648492(final SourceSubstituteMacroNodesContext _context) { return ((List<SNode>) _context.getVariable("var:sortedDecl")); } public static Object insertMacro_varValue_5697304327501000906(final TemplateVarContext _context) { return ListSequence.fromList(SModelOperations.roots(_context.getInputModel(), MetaAdapterFactory.getConcept(0x64d34fcdad024e73L, 0xaff8a581124c2e30L, 0x116b5695a8dL, "jetbrains.mps.lang.findUsages.structure.FinderDeclaration"))).sort(new ISelector<SNode, String>() { public String select(SNode it) { return SPropertyOperations.getString(it, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")); } }, true).toListSequence(); } private final Map<String, ReductionRuleCondition> rrcMethods = new HashMap<String, ReductionRuleCondition>(); { int i = 0; rrcMethods.put("1570228009929814969", new QueriesGenerated.RRC(i++)); } @Override @NotNull public ReductionRuleCondition getReductionRuleCondition(@NotNull QueryKey identity) { final String id = identity.getTemplateNode().getNodeId().toString(); if (!(rrcMethods.containsKey(id))) { return super.getReductionRuleCondition(identity); } return rrcMethods.get(id); } private static class RRC implements ReductionRuleCondition { private final int methodKey; public RRC(int methodKey) { this.methodKey = methodKey; } @Override public boolean check(ReductionRuleQueryContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return QueriesGenerated.baseMappingRule_Condition_1570228009929814973(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, CreateRootCondition> crcMethods = new HashMap<String, CreateRootCondition>(); { int i = 0; crcMethods.put("7991477654791680146", new QueriesGenerated.CRC(i++)); } @Override @NotNull public CreateRootCondition getCreateRootRuleCondition(@NotNull QueryKey identity) { String id = identity.getTemplateNode().getNodeId().toString(); if (!(crcMethods.containsKey(id))) { return super.getCreateRootRuleCondition(identity); } return crcMethods.get(id); } private static class CRC implements CreateRootCondition { private final int methodKey; public CRC(int methodKey) { this.methodKey = methodKey; } @Override public boolean check(@NotNull CreateRootRuleContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return QueriesGenerated.createRootRule_Condition_7991477654791680147(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, SourceNodeQuery> snqMethods = new HashMap<String, SourceNodeQuery>(); { int i = 0; snqMethods.put("4192433084863763900", new QueriesGenerated.SNQ(i++)); snqMethods.put("4192433084863763908", new QueriesGenerated.SNQ(i++)); snqMethods.put("4192433084863763927", new QueriesGenerated.SNQ(i++)); snqMethods.put("6818267381900889431", new QueriesGenerated.SNQ(i++)); snqMethods.put("1216396990767", new QueriesGenerated.SNQ(i++)); snqMethods.put("100784871586267457", new QueriesGenerated.SNQ(i++)); snqMethods.put("1197207280679", new QueriesGenerated.SNQ(i++)); snqMethods.put("1206533715312", new QueriesGenerated.SNQ(i++)); snqMethods.put("1206533783913", new QueriesGenerated.SNQ(i++)); snqMethods.put("1206462965299", new QueriesGenerated.SNQ(i++)); snqMethods.put("1206533809816", new QueriesGenerated.SNQ(i++)); snqMethods.put("1206533844017", new QueriesGenerated.SNQ(i++)); snqMethods.put("5097877160789322137", new QueriesGenerated.SNQ(i++)); snqMethods.put("5097877160789322156", new QueriesGenerated.SNQ(i++)); snqMethods.put("5097877160789322213", 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_4192433084863763900(ctx); case 1: return QueriesGenerated.sourceNodeQuery_4192433084863763908(ctx); case 2: return QueriesGenerated.sourceNodeQuery_4192433084863763927(ctx); case 3: return QueriesGenerated.sourceNodeQuery_6818267381900889431(ctx); case 4: return QueriesGenerated.sourceNodeQuery_1216396990767(ctx); case 5: return QueriesGenerated.sourceNodeQuery_100784871586267457(ctx); case 6: return QueriesGenerated.sourceNodeQuery_1197207280679(ctx); case 7: return QueriesGenerated.sourceNodeQuery_1206533715312(ctx); case 8: return QueriesGenerated.sourceNodeQuery_1206533783913(ctx); case 9: return QueriesGenerated.sourceNodeQuery_1206462965299(ctx); case 10: return QueriesGenerated.sourceNodeQuery_1206533809816(ctx); case 11: return QueriesGenerated.sourceNodeQuery_1206533844017(ctx); case 12: return QueriesGenerated.sourceNodeQuery_5097877160789322137(ctx); case 13: return QueriesGenerated.sourceNodeQuery_5097877160789322156(ctx); case 14: return QueriesGenerated.sourceNodeQuery_5097877160789322213(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("4192433084863763935", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("7518998791520133710", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("5697304327501119908", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("5697304327500648492", 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_4192433084863763935(ctx)); case 1: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_7518998791520133710(ctx)); case 2: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_5697304327501119908(ctx)); case 3: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_5697304327500648492(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("4192433084863763941", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("7518998791520133700", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("7518998791520106751", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("1197207280706", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "FinderClass")); pvqMethods.put("1202839664535", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "description")); pvqMethods.put("1202839710231", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "long description")); pvqMethods.put("7810572934689530074", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc59b314L, 0xf8cc59b315L, "value"), "1")); pvqMethods.put("5697304327500975267", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), null)); pvqMethods.put("5097877160789321858", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("5697304327500755468", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "modelRef")); pvqMethods.put("7991477654791693977", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "FindUsagesDescriptor")); pvqMethods.put("5697304327501139695", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc59b314L, 0xf8cc59b315L, "value"), "0")); pvqMethods.put("5697304327501150548", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc59b314L, 0xf8cc59b315L, "value"), "0")); pvqMethods.put("5697304327501193997", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); } @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_4192433084863763942(ctx); case 1: return QueriesGenerated.propertyMacro_GetPropertyValue_7518998791520133701(ctx); case 2: return QueriesGenerated.propertyMacro_GetPropertyValue_7518998791520106752(ctx); case 3: return QueriesGenerated.propertyMacro_GetPropertyValue_1197207280707(ctx); case 4: return QueriesGenerated.propertyMacro_GetPropertyValue_1202839664536(ctx); case 5: return QueriesGenerated.propertyMacro_GetPropertyValue_1202839710232(ctx); case 6: return QueriesGenerated.propertyMacro_GetPropertyValue_7810572934689530075(ctx); case 7: return QueriesGenerated.propertyMacro_GetPropertyValue_5697304327500975268(ctx); case 8: return QueriesGenerated.propertyMacro_GetPropertyValue_5097877160789321859(ctx); case 9: return QueriesGenerated.propertyMacro_GetPropertyValue_5697304327500755469(ctx); case 10: return QueriesGenerated.propertyMacro_GetPropertyValue_7991477654791693978(ctx); case 11: return QueriesGenerated.propertyMacro_GetPropertyValue_5697304327501139696(ctx); case 12: return QueriesGenerated.propertyMacro_GetPropertyValue_5697304327501150549(ctx); case 13: return QueriesGenerated.propertyMacro_GetPropertyValue_5697304327501193998(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, IfMacroCondition> imcMethods = new HashMap<String, IfMacroCondition>(); { int i = 0; imcMethods.put("4192433084863763887", new QueriesGenerated.IfMC(i++)); imcMethods.put("4192433084863763915", new QueriesGenerated.IfMC(i++)); imcMethods.put("1216396960790", new QueriesGenerated.IfMC(i++)); imcMethods.put("6297023828538094161", new QueriesGenerated.IfMC(i++)); imcMethods.put("100784871543542634", new QueriesGenerated.IfMC(i++)); imcMethods.put("1216397265032", new QueriesGenerated.IfMC(i++)); imcMethods.put("1216397326227", new QueriesGenerated.IfMC(i++)); imcMethods.put("8441762775552326214", new QueriesGenerated.IfMC(i++)); imcMethods.put("1218978335314", new QueriesGenerated.IfMC(i++)); imcMethods.put("1216397346722", new QueriesGenerated.IfMC(i++)); imcMethods.put("5697304327500936393", new QueriesGenerated.IfMC(i++)); imcMethods.put("5097877160789322144", new QueriesGenerated.IfMC(i++)); imcMethods.put("5097877160789322166", new QueriesGenerated.IfMC(i++)); imcMethods.put("5097877160789322201", new QueriesGenerated.IfMC(i++)); } @NotNull @Override public IfMacroCondition getIfMacroCondition(@NotNull QueryKey identity) { final String id = identity.getTemplateNode().getNodeId().toString(); if (!(imcMethods.containsKey(id))) { return super.getIfMacroCondition(identity); } return imcMethods.get(id); } private static class IfMC implements IfMacroCondition { private final int methodKey; public IfMC(int methodKey) { this.methodKey = methodKey; } @Override public boolean check(@NotNull IfMacroContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return QueriesGenerated.ifMacro_Condition_4192433084863763888(ctx); case 1: return QueriesGenerated.ifMacro_Condition_4192433084863763916(ctx); case 2: return QueriesGenerated.ifMacro_Condition_1216396960791(ctx); case 3: return QueriesGenerated.ifMacro_Condition_6297023828538094163(ctx); case 4: return QueriesGenerated.ifMacro_Condition_100784871543542637(ctx); case 5: return QueriesGenerated.ifMacro_Condition_1216397265033(ctx); case 6: return QueriesGenerated.ifMacro_Condition_1216397326228(ctx); case 7: return QueriesGenerated.ifMacro_Condition_8441762775552326216(ctx); case 8: return QueriesGenerated.ifMacro_Condition_1218978335315(ctx); case 9: return QueriesGenerated.ifMacro_Condition_1216397346723(ctx); case 10: return QueriesGenerated.ifMacro_Condition_5697304327500936395(ctx); case 11: return QueriesGenerated.ifMacro_Condition_5097877160789322145(ctx); case 12: return QueriesGenerated.ifMacro_Condition_5097877160789322167(ctx); case 13: return QueriesGenerated.ifMacro_Condition_5097877160789322202(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no condition method for if macro %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } } private final Map<String, ReferenceTargetQuery> rtqMethods = new HashMap<String, ReferenceTargetQuery>(); { rtqMethods.put("8928180329700848723", new QueriesGenerated.RTQ(0, "BaseConcept")); rtqMethods.put("5697304327501162559", new QueriesGenerated.RTQ(1, "BaseConcept")); rtqMethods.put("4147950839246952263", new QueriesGenerated.RTQ(2, "FindUsagesDescriptor")); } @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_8928180329700848724(ctx); case 1: return QueriesGenerated.referenceMacro_GetReferent_5697304327501162560(ctx); case 2: return QueriesGenerated.referenceMacro_GetReferent_4147950839246952264(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, VariableValueQuery> vvqMethods = new HashMap<String, VariableValueQuery>(); { vvqMethods.put("5697304327501000904", new QueriesGenerated.VVQ(0)); } @NotNull @Override public VariableValueQuery getVariableValueQuery(@NotNull QueryKey queryKey) { final String id = queryKey.getTemplateNode().getNodeId().toString(); if (!(vvqMethods.containsKey(id))) { return super.getVariableValueQuery(queryKey); } return vvqMethods.get(id); } private static class VVQ implements VariableValueQuery { private final int methodKey; /*package*/ VVQ(int methodKey) { this.methodKey = methodKey; } @Nullable public Object evaluate(@NotNull TemplateVarContext ctx) throws GenerationFailureException { switch (methodKey) { case 0: return QueriesGenerated.insertMacro_varValue_5697304327501000906(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } } }