package jetbrains.mps.lang.resources.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.PropertyMacroContext; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations; import org.jetbrains.mps.openapi.model.SNode; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations; import jetbrains.mps.util.JavaNameUtil; import jetbrains.mps.lang.resources.behavior.OldIconBundle__BehaviorDescriptor; import jetbrains.mps.lang.resources.behavior.Icon__BehaviorDescriptor; import jetbrains.mps.smodel.adapter.ids.MetaIdByDeclaration; 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.Map; import jetbrains.mps.generator.impl.query.CreateRootCondition; import java.util.HashMap; import org.jetbrains.annotations.NotNull; import jetbrains.mps.generator.impl.query.QueryKey; import jetbrains.mps.generator.impl.GenerationFailureException; 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_6759767305208033198(final CreateRootRuleContext _context) { return ListSequence.fromList(SModelOperations.nodes(_context.getInputModel(), MetaAdapterFactory.getConcept(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x7c8b08a50a39c6c3L, "jetbrains.mps.lang.resources.structure.IconExpression"))).isNotEmpty() || ListSequence.fromList(SModelOperations.nodes(_context.getInputModel(), MetaAdapterFactory.getConcept(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x52fb86deea79455eL, "jetbrains.mps.lang.resources.structure.IconResourceExpression"))).isNotEmpty(); } public static Object propertyMacro_GetPropertyValue_2990235398087431176(final PropertyMacroContext _context) { return SPropertyOperations.getString(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x7c8b08a50a39c6c7L, 0x7c8b08a50a39c6c8L, "declaration")), MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")); } public static Object propertyMacro_GetPropertyValue_2990235398087273707(final PropertyMacroContext _context) { SNode irb = SNodeOperations.getNodeAncestor(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x7c8b08a50a39c6c7L, 0x7c8b08a50a39c6c8L, "declaration")), MetaAdapterFactory.getConcept(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x7c8b08a50a39c6bdL, "jetbrains.mps.lang.resources.structure.OldIconBundle"), false, false); return JavaNameUtil.packageName(SNodeOperations.getModel(irb)) + "." + OldIconBundle__BehaviorDescriptor.getJavaName_id7Mb2akaesvf.invoke(irb); } public static Object propertyMacro_GetPropertyValue_7038317550322744907(final PropertyMacroContext _context) { return (String) OldIconBundle__BehaviorDescriptor.getJavaName_id7Mb2akaesvf.invoke(_context.getNode()); } public static Object propertyMacro_GetPropertyValue_2990235398086399637(final PropertyMacroContext _context) { return SPropertyOperations.getString(_context.getNode(), MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")); } public static Object propertyMacro_GetPropertyValue_2990235398086953162(final PropertyMacroContext _context) { return (String) OldIconBundle__BehaviorDescriptor.getJavaName_id7Mb2akaesvf.invoke(_context.getNode()); } public static Object propertyMacro_GetPropertyValue_1474977673367987868(final PropertyMacroContext _context) { return (String) Icon__BehaviorDescriptor.getResourceId_id2p1v3tOadt0.invoke(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x7c8b08a50a39c6c3L, 0x7c8b08a50a39c6c5L, "icon"))); } public static Object propertyMacro_GetPropertyValue_6759767305208041200(final PropertyMacroContext _context) { return _context.createUniqueName("ICON", null); } public static Object propertyMacro_GetPropertyValue_5979521222239286118(final PropertyMacroContext _context) { return _context.createUniqueName("RESOURCE_", null); } public static Object propertyMacro_GetPropertyValue_5979521222239286107(final PropertyMacroContext _context) { return (String) Icon__BehaviorDescriptor.getResourceId_id2p1v3tOadt0.invoke(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x52fb86deea79455eL, 0x52fb86deea79b940L, "icon"))); } public static Object propertyMacro_GetPropertyValue_8269982547288325753(final PropertyMacroContext _context) { long msb = MetaIdByDeclaration.getConceptId(_context.getNode()).getLanguageId().getIdValue().getMostSignificantBits(); return "0x" + Long.toHexString(msb) + "L"; } public static Object propertyMacro_GetPropertyValue_8269982547288403552(final PropertyMacroContext _context) { long lsb = MetaIdByDeclaration.getConceptId(_context.getNode()).getLanguageId().getIdValue().getLeastSignificantBits(); return "0x" + Long.toHexString(lsb) + "L"; } public static Object propertyMacro_GetPropertyValue_8269982547288411858(final PropertyMacroContext _context) { long id = MetaIdByDeclaration.getConceptId(_context.getNode()).getIdValue(); return "0x" + Long.toHexString(id) + "L"; } public static Object propertyMacro_GetPropertyValue_8269982547288435644(final PropertyMacroContext _context) { return NameUtil.nodeFQName(_context.getNode()); } public static Object propertyMacro_GetPropertyValue_6638738203687387540(final PropertyMacroContext _context) { long msb = MetaIdByDeclaration.getConceptId(_context.getNode()).getLanguageId().getIdValue().getMostSignificantBits(); return "0x" + Long.toHexString(msb) + "L"; } public static Object propertyMacro_GetPropertyValue_6638738203687387557(final PropertyMacroContext _context) { long lsb = MetaIdByDeclaration.getConceptId(_context.getNode()).getLanguageId().getIdValue().getLeastSignificantBits(); return "0x" + Long.toHexString(lsb) + "L"; } public static Object propertyMacro_GetPropertyValue_6638738203687387574(final PropertyMacroContext _context) { long id = MetaIdByDeclaration.getConceptId(_context.getNode()).getIdValue(); return "0x" + Long.toHexString(id) + "L"; } public static Object propertyMacro_GetPropertyValue_6638738203687387587(final PropertyMacroContext _context) { return NameUtil.nodeFQName(_context.getNode()); } public static Object referenceMacro_GetReferent_6759767305208080925(final ReferenceMacroContext _context) { return _context.getOutputNodeByMappingLabel("map_IconContainer", null); } public static Object referenceMacro_GetReferent_6759767305208080928(final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "map_IconField"); } public static Object referenceMacro_GetReferent_2990235398086953122(final ReferenceMacroContext _context) { return (String) OldIconBundle__BehaviorDescriptor.getJavaName_id7Mb2akaesvf.invoke(_context.getNode()); } public static Object referenceMacro_GetReferent_2990235398086953146(final ReferenceMacroContext _context) { return (String) OldIconBundle__BehaviorDescriptor.getJavaName_id7Mb2akaesvf.invoke(_context.getNode()); } public static Object referenceMacro_GetReferent_2990235398086953187(final ReferenceMacroContext _context) { return (String) OldIconBundle__BehaviorDescriptor.getJavaName_id7Mb2akaesvf.invoke(_context.getNode()); } public static Object referenceMacro_GetReferent_5979521222239280705(final ReferenceMacroContext _context) { return _context.getOutputNodeByMappingLabel("map_IconContainer", null); } public static Object referenceMacro_GetReferent_5979521222239280712(final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "map_IconResourceField"); } public static boolean ifMacro_Condition_4965310991037828399(final IfMacroContext _context) { return Icon__BehaviorDescriptor.getResourceId_id2p1v3tOadt0.invoke(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x7c8b08a50a39c6c3L, 0x7c8b08a50a39c6c5L, "icon"))) != null; } public static boolean ifMacro_Condition_4786190798786384253(final IfMacroContext _context) { return (SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x7ce01982590bd1eL, 0x426bf72c54e74e64L, "concept")) == null); } public static boolean ifMacro_Condition_4786190798786580768(final IfMacroContext _context) { return SNodeOperations.isInstanceOf(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x7ce01982590bd1eL, 0x426bf72c54e74e64L, "concept")), MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x1120c45902cL, "jetbrains.mps.lang.smodel.structure.RefConcept_Reference")); } public static boolean ifMacro_Condition_6638738203687335897(final IfMacroContext _context) { return SNodeOperations.isInstanceOf(_context.getNode(), MetaAdapterFactory.getConcept(0xc72da2b97cce4447L, 0x8389f407dc1158b7L, 0xf979ba0450L, "jetbrains.mps.lang.structure.structure.ConceptDeclaration")); } public static SNode sourceNodeQuery_8814893218132245226(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x7c8b08a50a39c6c0L, 0x7c8b08a50a39c6c1L, "iconExpression")); } public static SNode sourceNodeQuery_4965310991037946893(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(SNodeOperations.cast(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x7c8b08a50a39c6c3L, 0x7c8b08a50a39c6c5L, "icon")), MetaAdapterFactory.getConcept(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x7c8b08a50a39c6bbL, "jetbrains.mps.lang.resources.structure.FileIcon")), MetaAdapterFactory.getContainmentLink(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x7c8b08a50a39c6bbL, 0x60d1cf8c81faea09L, "iconExpression")); } public static SNode sourceNodeQuery_4786190798786581656(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(SNodeOperations.cast(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x7ce01982590bd1eL, 0x426bf72c54e74e64L, "concept")), MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x11885c0d945L, "jetbrains.mps.lang.smodel.structure.PoundExpression")), MetaAdapterFactory.getContainmentLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x11885c0d945L, 0x11885c11e0fL, "expression")); } public static SNode sourceNodeQuery_2565258849285850021(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(SNodeOperations.cast(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x7ce01982590bd1eL, 0x426bf72c54e74e64L, "concept")), MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x1120c45902cL, "jetbrains.mps.lang.smodel.structure.RefConcept_Reference")), MetaAdapterFactory.getReferenceLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x1120c45902cL, 0x1120c45d024L, "conceptDeclaration")); } public static SNode sourceNodeQuery_562388756444871926(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x7ce01982590bd1eL, 0x7ce01982590bd48L, "concept_old")); } public static SNode sourceNodeQuery_562388756444903398(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x7ce019825925c1aL, 0x7ce019825925c1cL, "node")); } public static Iterable<SNode> sourceNodesQuery_2990235398086399665(final SourceSubstituteMacroNodesContext _context) { return SLinkOperations.getChildren(_context.getNode(), MetaAdapterFactory.getContainmentLink(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x7c8b08a50a39c6bdL, 0x7c8b08a50a39c6beL, "icons")); } public static Iterable<SNode> sourceNodesQuery_6759767305208041204(final SourceSubstituteMacroNodesContext _context) { return SModelOperations.nodes(_context.getInputModel(), MetaAdapterFactory.getConcept(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x7c8b08a50a39c6c3L, "jetbrains.mps.lang.resources.structure.IconExpression")); } public static Iterable<SNode> sourceNodesQuery_5979521222239286126(final SourceSubstituteMacroNodesContext _context) { return SModelOperations.nodes(_context.getInputModel(), MetaAdapterFactory.getConcept(0x982eb8df2c964bd7L, 0x996311712ea622e5L, 0x52fb86deea79455eL, "jetbrains.mps.lang.resources.structure.IconResourceExpression")); } private final Map<String, CreateRootCondition> crcMethods = new HashMap<String, CreateRootCondition>(); { int i = 0; crcMethods.put("6759767305208033197", 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_6759767305208033198(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("8814893218132245226", new QueriesGenerated.SNQ(i++)); snqMethods.put("4965310991037946893", new QueriesGenerated.SNQ(i++)); snqMethods.put("4786190798786581656", new QueriesGenerated.SNQ(i++)); snqMethods.put("2565258849285850021", new QueriesGenerated.SNQ(i++)); snqMethods.put("562388756444871926", new QueriesGenerated.SNQ(i++)); snqMethods.put("562388756444903398", 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_8814893218132245226(ctx); case 1: return QueriesGenerated.sourceNodeQuery_4965310991037946893(ctx); case 2: return QueriesGenerated.sourceNodeQuery_4786190798786581656(ctx); case 3: return QueriesGenerated.sourceNodeQuery_2565258849285850021(ctx); case 4: return QueriesGenerated.sourceNodeQuery_562388756444871926(ctx); case 5: return QueriesGenerated.sourceNodeQuery_562388756444903398(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("2990235398086399665", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("6759767305208041204", new QueriesGenerated.SNsQ(i++)); snsqMethods.put("5979521222239286126", 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_2990235398086399665(ctx)); case 1: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_6759767305208041204(ctx)); case 2: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_5979521222239286126(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("2990235398087431175", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("2990235398087273706", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xdf345b11b8c74213L, 0xac6648d2a9b75d88L, 0x1115749abe3L, 0x1115767a8eeL, "fqClassName"), "IconResourceBundle")); pvqMethods.put("7038317550322744906", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "IconResourceBundle")); pvqMethods.put("2990235398086399636", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "")); pvqMethods.put("2990235398086953161", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), null)); pvqMethods.put("1474977673367987867", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "pathToIcon")); pvqMethods.put("6759767305208041199", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "ICON")); pvqMethods.put("5979521222239286117", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "RESOURCE")); pvqMethods.put("5979521222239286106", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "pathToIcon")); pvqMethods.put("8269982547288325752", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x3b418722717710b4L, 0x3b418722717710b5L, "value"), "0l")); pvqMethods.put("8269982547288403551", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x3b418722717710b4L, 0x3b418722717710b5L, "value"), "0l")); pvqMethods.put("8269982547288411857", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x3b418722717710b4L, 0x3b418722717710b5L, "value"), "0l")); pvqMethods.put("8269982547288435643", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "fqName")); pvqMethods.put("6638738203687387539", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x3b418722717710b4L, 0x3b418722717710b5L, "value"), "0l")); pvqMethods.put("6638738203687387556", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x3b418722717710b4L, 0x3b418722717710b5L, "value"), "0l")); pvqMethods.put("6638738203687387573", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x3b418722717710b4L, 0x3b418722717710b5L, "value"), "0l")); pvqMethods.put("6638738203687387586", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), "fqName")); } @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_2990235398087431176(ctx); case 1: return QueriesGenerated.propertyMacro_GetPropertyValue_2990235398087273707(ctx); case 2: return QueriesGenerated.propertyMacro_GetPropertyValue_7038317550322744907(ctx); case 3: return QueriesGenerated.propertyMacro_GetPropertyValue_2990235398086399637(ctx); case 4: return QueriesGenerated.propertyMacro_GetPropertyValue_2990235398086953162(ctx); case 5: return QueriesGenerated.propertyMacro_GetPropertyValue_1474977673367987868(ctx); case 6: return QueriesGenerated.propertyMacro_GetPropertyValue_6759767305208041200(ctx); case 7: return QueriesGenerated.propertyMacro_GetPropertyValue_5979521222239286118(ctx); case 8: return QueriesGenerated.propertyMacro_GetPropertyValue_5979521222239286107(ctx); case 9: return QueriesGenerated.propertyMacro_GetPropertyValue_8269982547288325753(ctx); case 10: return QueriesGenerated.propertyMacro_GetPropertyValue_8269982547288403552(ctx); case 11: return QueriesGenerated.propertyMacro_GetPropertyValue_8269982547288411858(ctx); case 12: return QueriesGenerated.propertyMacro_GetPropertyValue_8269982547288435644(ctx); case 13: return QueriesGenerated.propertyMacro_GetPropertyValue_6638738203687387540(ctx); case 14: return QueriesGenerated.propertyMacro_GetPropertyValue_6638738203687387557(ctx); case 15: return QueriesGenerated.propertyMacro_GetPropertyValue_6638738203687387574(ctx); case 16: return QueriesGenerated.propertyMacro_GetPropertyValue_6638738203687387587(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("4965310991037828397", new QueriesGenerated.IfMC(i++)); imcMethods.put("4786190798786384251", new QueriesGenerated.IfMC(i++)); imcMethods.put("4786190798786580766", new QueriesGenerated.IfMC(i++)); imcMethods.put("6638738203687335894", 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_4965310991037828399(ctx); case 1: return QueriesGenerated.ifMacro_Condition_4786190798786384253(ctx); case 2: return QueriesGenerated.ifMacro_Condition_4786190798786580768(ctx); case 3: return QueriesGenerated.ifMacro_Condition_6638738203687335897(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("6759767305208080924", new QueriesGenerated.RTQ(0, "TemplateClass")); rtqMethods.put("6759767305208080927", new QueriesGenerated.RTQ(1, "FIELD")); rtqMethods.put("2990235398086953121", new QueriesGenerated.RTQ(2, "IconResourceBundle")); rtqMethods.put("2990235398086953145", new QueriesGenerated.RTQ(3, "IconResourceBundle")); rtqMethods.put("2990235398086953186", new QueriesGenerated.RTQ(4, "IconResourceBundle")); rtqMethods.put("5979521222239280704", new QueriesGenerated.RTQ(5, "TemplateClass")); rtqMethods.put("5979521222239280711", new QueriesGenerated.RTQ(6, "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_6759767305208080925(ctx); case 1: return QueriesGenerated.referenceMacro_GetReferent_6759767305208080928(ctx); case 2: return QueriesGenerated.referenceMacro_GetReferent_2990235398086953122(ctx); case 3: return QueriesGenerated.referenceMacro_GetReferent_2990235398086953146(ctx); case 4: return QueriesGenerated.referenceMacro_GetReferent_2990235398086953187(ctx); case 5: return QueriesGenerated.referenceMacro_GetReferent_5979521222239280705(ctx); case 6: return QueriesGenerated.referenceMacro_GetReferent_5979521222239280712(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } } } }