package jetbrains.mps.lang.extension.generator.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.internal.collections.runtime.ListSequence; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SModelOperations; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import jetbrains.mps.generator.template.BaseMappingRuleContext; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations; import jetbrains.mps.generator.template.PropertyMacroContext; import jetbrains.mps.lang.extension.behavior.IRootWithUniqueName__BehaviorDescriptor; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations; import jetbrains.mps.lang.extension.behavior.ExtensionDeclaration__BehaviorDescriptor; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations; import jetbrains.mps.generator.template.ReferenceMacroContext; import jetbrains.mps.internal.collections.runtime.Sequence; import jetbrains.mps.baseLanguage.behavior.ClassConcept__BehaviorDescriptor; import jetbrains.mps.generator.template.IfMacroContext; import org.jetbrains.mps.openapi.model.SNode; import jetbrains.mps.generator.template.SourceSubstituteMacroNodeContext; import jetbrains.mps.baseLanguage.closures.constraints.ClassifierTypeUtil; import jetbrains.mps.lang.extension.behavior.ExtensionObjectGetter__BehaviorDescriptor; import jetbrains.mps.generator.template.SourceSubstituteMacroNodesContext; 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.MapRootRuleCondition; import jetbrains.mps.generator.template.MapRootRuleContext; 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; @Generated public class QueriesGenerated extends QueryProviderBase { public QueriesGenerated() { super(1); } public static boolean createRootRule_Condition_63012922130977735(final CreateRootRuleContext _context) { return ListSequence.fromList(SModelOperations.roots(_context.getInputModel(), MetaAdapterFactory.getConcept(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d6L, "jetbrains.mps.lang.extension.structure.ExtensionPointDeclaration"))).isNotEmpty() || ListSequence.fromList(SModelOperations.roots(_context.getInputModel(), MetaAdapterFactory.getConcept(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d4L, "jetbrains.mps.lang.extension.structure.ExtensionDeclaration"))).isNotEmpty() || ListSequence.fromList(SModelOperations.nodes(_context.getInputModel(), MetaAdapterFactory.getConcept(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x1c30c5b543be3b2L, "jetbrains.mps.lang.extension.structure.Extension"))).isNotEmpty(); } public static boolean baseMappingRule_Condition_6764742996907465898(final BaseMappingRuleContext _context) { return (SNodeOperations.getParent(_context.getNode()) == null); } public static boolean baseMappingRule_Condition_6764742996907474372(final BaseMappingRuleContext _context) { return (SNodeOperations.getParent(_context.getNode()) != null); } public static Object propertyMacro_GetPropertyValue_4230423796260420199(final PropertyMacroContext _context) { return (String) IRootWithUniqueName__BehaviorDescriptor.getId_id3vRuGRRXlj.invoke(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x5bf74eafefe0e940L, 0x5bf74eafefe0eb55L, "extensionPoint"))); } public static Object propertyMacro_GetPropertyValue_63012922130955117(final PropertyMacroContext _context) { return (String) IRootWithUniqueName__BehaviorDescriptor.getId_id3vRuGRRXlj.invoke(_context.getNode()); } public static Object propertyMacro_GetPropertyValue_8820339482096486801(final PropertyMacroContext _context) { return _context.createUniqueName(ExtensionDeclaration__BehaviorDescriptor.getJavaName_id4y_vFkED6Yj.invoke(_context.getNode()), null); } public static Object propertyMacro_GetPropertyValue_7036359038356140565(final PropertyMacroContext _context) { return SPropertyOperations.getString(_context.getNode(), MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")); } public static Object propertyMacro_GetPropertyValue_63012922130951121(final PropertyMacroContext _context) { return (String) IRootWithUniqueName__BehaviorDescriptor.getId_id3vRuGRRXlj.invoke(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d4L, 0x33c018482cafa9d5L, "extensionPoint"))); } public static Object propertyMacro_GetPropertyValue_4103205777867236850(final PropertyMacroContext _context) { return (String) IRootWithUniqueName__BehaviorDescriptor.getId_id3vRuGRRXlj.invoke(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x1c30c5b543be3b2L, 0x1c30c5b543be565L, "extensionPoint"))); } public static Object propertyMacro_GetPropertyValue_4103205777867117298(final PropertyMacroContext _context) { return SPropertyOperations.getString(_context.getNode(), MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")); } public static Object propertyMacro_GetPropertyValue_1778592072147427289(final PropertyMacroContext _context) { return (String) IRootWithUniqueName__BehaviorDescriptor.getId_id3vRuGRRXlj.invoke(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x1c30c5b543be3b2L, 0x1c30c5b543be565L, "extensionPoint"))); } public static Object propertyMacro_GetPropertyValue_1778592072147427308(final PropertyMacroContext _context) { return SPropertyOperations.getString(_context.getNode(), MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")); } public static Object referenceMacro_GetReferent_63012922130977670(final ReferenceMacroContext _context) { return Sequence.fromIterable(ClassConcept__BehaviorDescriptor.constructors_id4_LVZ3pCvsd.invoke(_context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "extensionClassOld"))).first(); } public static Object referenceMacro_GetReferent_4103205777867490222(final ReferenceMacroContext _context) { return Sequence.fromIterable(ClassConcept__BehaviorDescriptor.constructors_id4_LVZ3pCvsd.invoke(_context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "extensionClass"))).first(); } public static Object referenceMacro_GetReferent_7036359038356141310(final ReferenceMacroContext _context) { return SPropertyOperations.getString(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x61a62b43e1534e9eL, 0x61a62b43e1534e9fL, "declaration")), MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")); } public static boolean ifMacro_Condition_63012922130953655(final IfMacroContext _context) { return ListSequence.fromList(SModelOperations.roots(_context.getInputModel(), MetaAdapterFactory.getConcept(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d6L, "jetbrains.mps.lang.extension.structure.ExtensionPointDeclaration"))).isNotEmpty(); } public static boolean ifMacro_Condition_63012922130955159(final IfMacroContext _context) { return ListSequence.fromList(SModelOperations.roots(_context.getInputModel(), MetaAdapterFactory.getConcept(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d4L, "jetbrains.mps.lang.extension.structure.ExtensionDeclaration"))).isNotEmpty() || ListSequence.fromList(SModelOperations.nodes(_context.getInputModel(), MetaAdapterFactory.getConcept(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x1c30c5b543be3b2L, "jetbrains.mps.lang.extension.structure.Extension"))).isNotEmpty(); } public static boolean ifMacro_Condition_8820339482096486134(final IfMacroContext _context) { return ListSequence.fromList(SModelOperations.roots(_context.getInputModel(), MetaAdapterFactory.getConcept(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d6L, "jetbrains.mps.lang.extension.structure.ExtensionPointDeclaration"))).isNotEmpty(); } public static boolean ifMacro_Condition_8820339482096486138(final IfMacroContext _context) { return ListSequence.fromList(SModelOperations.roots(_context.getInputModel(), MetaAdapterFactory.getConcept(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d4L, "jetbrains.mps.lang.extension.structure.ExtensionDeclaration"))).isNotEmpty() || ListSequence.fromList(SModelOperations.nodes(_context.getInputModel(), MetaAdapterFactory.getConcept(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x1c30c5b543be3b2L, "jetbrains.mps.lang.extension.structure.Extension"))).isNotEmpty(); } public static boolean ifMacro_Condition_7036359038356140443(final IfMacroContext _context) { return (SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d4L, 0x61a62b43e15253eeL, "activator")) != null); } public static boolean ifMacro_Condition_7036359038356140490(final IfMacroContext _context) { return (SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d4L, 0x61a62b43e15253f6L, "deactivator")) != null); } public static SNode sourceNodeQuery_4230423796260420184(final SourceSubstituteMacroNodeContext _context) { return ClassifierTypeUtil.getTypeCoercedToClassifierType(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x5bf74eafefe0e940L, 0x5bf74eafefe0eb55L, "extensionPoint")), MetaAdapterFactory.getContainmentLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d6L, 0x6f6f7f3b7a17bd0bL, "objectType"))); } public static SNode sourceNodeQuery_3175313036448599345(final SourceSubstituteMacroNodeContext _context) { return ClassifierTypeUtil.getTypeCoercedToClassifierType(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x2c10fa62142eb538L, 0x2c10fa62142eb539L, "extensionPoint")), MetaAdapterFactory.getContainmentLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d6L, 0x6f6f7f3b7a17bd0bL, "objectType"))); } public static SNode sourceNodeQuery_4585329983368332167(final SourceSubstituteMacroNodeContext _context) { return (SNode) ExtensionObjectGetter__BehaviorDescriptor.getReturnClassifierType_id6j5CbT7vrku.invoke(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d4L, 0x6f6f7f3b7a17bd13L, "objectGetter"))); } public static SNode sourceNodeQuery_7036359038356140555(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x61a62b43e1534e99L, 0x61a62b43e1534e9dL, "fieldType")); } public static SNode sourceNodeQuery_7261386713308444323(final SourceSubstituteMacroNodeContext _context) { return (SNode) ExtensionObjectGetter__BehaviorDescriptor.getReturnClassifierType_id6j5CbT7vrku.invoke(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d4L, 0x6f6f7f3b7a17bd13L, "objectGetter"))); } public static SNode sourceNodeQuery_7036359038356140466(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d4L, 0x61a62b43e15253eeL, "activator")), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x108bbca0f48L, 0x108bbd29b4aL, "body")); } public static SNode sourceNodeQuery_7036359038356140513(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d4L, 0x61a62b43e15253f6L, "deactivator")), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x108bbca0f48L, 0x108bbd29b4aL, "body")); } public static SNode sourceNodeQuery_2141245758541409318(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x1c30c5b543be3b2L, 0x1c30c5b543be565L, "extensionPoint")), MetaAdapterFactory.getContainmentLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d6L, 0x6f6f7f3b7a17bd0bL, "objectType")); } public static SNode sourceNodeQuery_1778592072147427317(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x1c30c5b543be3b2L, 0x1c30c5b543be565L, "extensionPoint")), MetaAdapterFactory.getContainmentLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d6L, 0x6f6f7f3b7a17bd0bL, "objectType")); } public static Iterable<SNode> sourceNodesQuery_63012922130955093(final SourceSubstituteMacroNodesContext _context) { return ListSequence.fromList(SModelOperations.roots(_context.getInputModel(), MetaAdapterFactory.getConcept(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d6L, "jetbrains.mps.lang.extension.structure.ExtensionPointDeclaration"))).sort(new ISelector<SNode, String>() { public String select(SNode it) { return SPropertyOperations.getString(it, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")); } }, true); } public static Iterable<SNode> sourceNodesQuery_63012922130977659(final SourceSubstituteMacroNodesContext _context) { return ListSequence.fromList(SModelOperations.roots(_context.getInputModel(), MetaAdapterFactory.getConcept(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d4L, "jetbrains.mps.lang.extension.structure.ExtensionDeclaration"))).sort(new ISelector<SNode, String>() { public String select(SNode it) { return SPropertyOperations.getString(SLinkOperations.getTarget(it, MetaAdapterFactory.getReferenceLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d4L, 0x33c018482cafa9d5L, "extensionPoint")), MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")); } }, true); } public static Iterable<SNode> sourceNodesQuery_4103205777867490234(final SourceSubstituteMacroNodesContext _context) { return ListSequence.fromList(SModelOperations.nodes(_context.getInputModel(), MetaAdapterFactory.getConcept(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x1c30c5b543be3b2L, "jetbrains.mps.lang.extension.structure.Extension"))).sort(new ISelector<SNode, String>() { public String select(SNode it) { return SPropertyOperations.getString(SLinkOperations.getTarget(it, MetaAdapterFactory.getReferenceLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x1c30c5b543be3b2L, 0x1c30c5b543be565L, "extensionPoint")), MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")); } }, true); } public static Iterable<SNode> sourceNodesQuery_7036359038356269822(final SourceSubstituteMacroNodesContext _context) { return SLinkOperations.getChildren(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d4L, 0x61a62b43e1534edcL, "fieldDeclaration")); } public static Iterable<SNode> sourceNodesQuery_7261386713308446738(final SourceSubstituteMacroNodesContext _context) { return SLinkOperations.getChildren(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x33c018482cafa9d4L, 0x6f6f7f3b7a17bd13L, "objectGetter")), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x108bbca0f48L, 0x108bbd29b4aL, "body")), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b200L, 0xf8cc6bf961L, "statement")); } public static Iterable<SNode> sourceNodesQuery_4103205777867126758(final SourceSubstituteMacroNodesContext _context) { return SLinkOperations.getChildren(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101d9d3ca30L, 0x4a9a46de59132803L, "member")); } public static Iterable<SNode> sourceNodesQuery_1778592072147427299(final SourceSubstituteMacroNodesContext _context) { return SLinkOperations.getChildren(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101d9d3ca30L, 0x4a9a46de59132803L, "member")); } private final Map<String, ReductionRuleCondition> rrcMethods = new HashMap<String, ReductionRuleCondition>(); { int i = 0; rrcMethods.put("1778592072147425062", 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_6764742996907474372(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, MapRootRuleCondition> mrrcMethods = new HashMap<String, MapRootRuleCondition>(); { int i = 0; mrrcMethods.put("4103205777867107082", 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_6764742996907465898(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("63012922130977734", 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_63012922130977735(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("4230423796260420184", new QueriesGenerated.SNQ(i++)); snqMethods.put("3175313036448599345", new QueriesGenerated.SNQ(i++)); snqMethods.put("4585329983368332167", new QueriesGenerated.SNQ(i++)); snqMethods.put("7036359038356140555", new QueriesGenerated.SNQ(i++)); snqMethods.put("7261386713308444323", new QueriesGenerated.SNQ(i++)); snqMethods.put("7036359038356140466", new QueriesGenerated.SNQ(i++)); snqMethods.put("7036359038356140513", new QueriesGenerated.SNQ(i++)); snqMethods.put("2141245758541409318", new QueriesGenerated.SNQ(i++)); snqMethods.put("1778592072147427317", 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_4230423796260420184(ctx); case 1: return QueriesGenerated.sourceNodeQuery_3175313036448599345(ctx); case 2: return QueriesGenerated.sourceNodeQuery_4585329983368332167(ctx); case 3: return QueriesGenerated.sourceNodeQuery_7036359038356140555(ctx); case 4: return QueriesGenerated.sourceNodeQuery_7261386713308444323(ctx); case 5: return QueriesGenerated.sourceNodeQuery_7036359038356140466(ctx); case 6: return QueriesGenerated.sourceNodeQuery_7036359038356140513(ctx); case 7: return QueriesGenerated.sourceNodeQuery_2141245758541409318(ctx); case 8: return QueriesGenerated.sourceNodeQuery_1778592072147427317(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("63012922130955093", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("63012922130977659", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("4103205777867490234", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("7036359038356269822", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("7261386713308446738", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("4103205777867126758", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("1778592072147427299", 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_63012922130955093(ctx)); case 1: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_63012922130977659(ctx)); case 2: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_4103205777867490234(ctx)); case 3: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_7036359038356269822(ctx)); case 4: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_7261386713308446738(ctx)); case 5: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_4103205777867126758(ctx)); case 6: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_1778592072147427299(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("4230423796260420198", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("63012922130955116", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("8820339482096486800", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "Extension")); pvqMethods.put("7036359038356140562", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "field")); pvqMethods.put("63012922130951120", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("4103205777867236849", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("4103205777867117297", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "map_Extension")); pvqMethods.put("1778592072147427288", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("1778592072147427307", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "reduce_Extension")); } @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_4230423796260420199(ctx); case 1: return QueriesGenerated.propertyMacro_GetPropertyValue_63012922130955117(ctx); case 2: return QueriesGenerated.propertyMacro_GetPropertyValue_8820339482096486801(ctx); case 3: return QueriesGenerated.propertyMacro_GetPropertyValue_7036359038356140565(ctx); case 4: return QueriesGenerated.propertyMacro_GetPropertyValue_63012922130951121(ctx); case 5: return QueriesGenerated.propertyMacro_GetPropertyValue_4103205777867236850(ctx); case 6: return QueriesGenerated.propertyMacro_GetPropertyValue_4103205777867117298(ctx); case 7: return QueriesGenerated.propertyMacro_GetPropertyValue_1778592072147427289(ctx); case 8: return QueriesGenerated.propertyMacro_GetPropertyValue_1778592072147427308(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("63012922130953654", new QueriesGenerated.IfMC(i++)); imcMethods.put("63012922130955158", new QueriesGenerated.IfMC(i++)); imcMethods.put("8820339482096486133", new QueriesGenerated.IfMC(i++)); imcMethods.put("8820339482096486137", new QueriesGenerated.IfMC(i++)); imcMethods.put("7036359038356140442", new QueriesGenerated.IfMC(i++)); imcMethods.put("7036359038356140489", 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_63012922130953655(ctx); case 1: return QueriesGenerated.ifMacro_Condition_63012922130955159(ctx); case 2: return QueriesGenerated.ifMacro_Condition_8820339482096486134(ctx); case 3: return QueriesGenerated.ifMacro_Condition_8820339482096486138(ctx); case 4: return QueriesGenerated.ifMacro_Condition_7036359038356140443(ctx); case 5: return QueriesGenerated.ifMacro_Condition_7036359038356140490(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("63012922130977669", new QueriesGenerated.RTQ(0, "Extension")); rtqMethods.put("4103205777867490221", new QueriesGenerated.RTQ(1, "Extension")); rtqMethods.put("7036359038356141309", new QueriesGenerated.RTQ(2, "field")); } @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_63012922130977670(ctx); case 1: return QueriesGenerated.referenceMacro_GetReferent_4103205777867490222(ctx); case 2: return QueriesGenerated.referenceMacro_GetReferent_7036359038356141310(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } } }