package jetbrains.mps.baseLanguage.generator.java.closures;
/*Generated by MPS */
import jetbrains.mps.generator.runtime.Generated;
import jetbrains.mps.generator.impl.query.QueryProviderBase;
import jetbrains.mps.generator.template.BaseMappingRuleContext;
import jetbrains.mps.baseLanguage.generator.java.closures.util.ClosuresUtil;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.generator.template.PropertyMacroContext;
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 jetbrains.mps.generator.template.SourceSubstituteMacroNodeContext;
import jetbrains.mps.baseLanguage.generator.java.closures.util.QueriesUtil;
import jetbrains.mps.generator.template.SourceSubstituteMacroNodesContext;
import jetbrains.mps.baseLanguage.generator.java.closures.util._QueriesUtil;
import jetbrains.mps.generator.template.WeavingMappingRuleContext;
import jetbrains.mps.generator.template.TemplateQueryContext;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SModelOperations;
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.WeaveRuleCondition;
import jetbrains.mps.generator.impl.query.WeaveRuleQuery;
import jetbrains.mps.generator.impl.query.WeaveAnchorQuery;
import org.jetbrains.annotations.Nullable;
import jetbrains.mps.generator.template.WeavingAnchorContext;
import jetbrains.mps.generator.impl.query.MapConfigurationCondition;
import jetbrains.mps.generator.impl.query.SourceNodeQuery;
import jetbrains.mps.generator.impl.query.QueryKeyImpl;
import jetbrains.mps.generator.impl.query.SourceNodesQuery;
import java.util.Collection;
import jetbrains.mps.util.IterableUtil;
import jetbrains.mps.generator.impl.query.PropertyValueQuery;
import org.jetbrains.mps.openapi.language.SProperty;
import jetbrains.mps.generator.impl.query.IfMacroCondition;
import jetbrains.mps.generator.impl.query.ReferenceTargetQuery;
@Generated
public class QueriesGenerated extends QueryProviderBase {
public QueriesGenerated() {
super(1);
}
public static boolean baseMappingRule_Condition_1170282608160(final BaseMappingRuleContext _context) {
return ClosuresUtil.hasVariablesUsedInClosure(_context.getNode(), _context);
}
public static boolean baseMappingRule_Condition_1170282061477(final BaseMappingRuleContext _context) {
if (!(SNodeOperations.isInstanceOf(_context.getNode(), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x10c63f4f3f3L, "jetbrains.mps.baseLanguage.structure.Closure")))) {
return ClosuresUtil.hasVariablesUsedInClosure(_context.getNode(), _context);
}
return false;
}
public static boolean baseMappingRule_Condition_1170198286262(final BaseMappingRuleContext _context) {
SNode parent = SNodeOperations.getParent(_context.getNode());
if (ClosuresUtil.isClosureContextOwner(parent)) {
return ClosuresUtil.hasVariablesUsedInClosure(parent, _context);
}
return false;
}
public static boolean baseMappingRule_Condition_1170198485461(final BaseMappingRuleContext _context) {
return SNodeOperations.getNodeAncestor(_context.getNode(), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x10c63f4f3f3L, "jetbrains.mps.baseLanguage.structure.Closure"), false, false) != null;
}
public static boolean baseMappingRule_Condition_1842587602196092389(final BaseMappingRuleContext _context) {
SNode var = SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c77f1e98L, 0xf8cc6bf960L, "variableDeclaration"));
if (!((SNodeOperations.isInstanceOf(var, MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7efL, "jetbrains.mps.baseLanguage.structure.LocalVariableDeclaration")) || SNodeOperations.isInstanceOf(var, MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c77f1e94L, "jetbrains.mps.baseLanguage.structure.ParameterDeclaration"))))) {
return false;
}
SNode contextOwner = ClosuresUtil.findEnclosingClosureContextOwner(var);
if (contextOwner != null) {
return ClosuresUtil.isVariableUsedInClosure(contextOwner, var, _context);
}
return false;
}
public static boolean baseMappingRule_Condition_1170199119856(final BaseMappingRuleContext _context) {
SNode var = SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7f0L, 0xf8cc67c7f1L, "localVariableDeclaration"));
if (SLinkOperations.getTarget(var, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37a7f6eL, 0xf8c37f506eL, "initializer")) != null) {
SNode contextOwner = ClosuresUtil.findEnclosingClosureContextOwner(var);
if (contextOwner != null) {
return ClosuresUtil.isVariableUsedInClosure(contextOwner, var, _context);
}
}
return false;
}
public static Object propertyMacro_GetPropertyValue_1170707207731(final PropertyMacroContext _context) {
return _context.createUniqueName("zClosureContext", null);
}
public static Object propertyMacro_GetPropertyValue_1170347597854(final PropertyMacroContext _context) {
// XXX in fact, template's input node is contextOwner
SNode contextOwner = ClosuresUtil.findEnclosingClosureContextOwner(_context.getNode());
return ClosuresUtil.getVariableNameInClosureContext(contextOwner, _context.getNode(), _context);
}
public static Object propertyMacro_GetPropertyValue_1170707554571(final PropertyMacroContext _context) {
return _context.createUniqueName("_zClosureContext", null);
}
public static Object propertyMacro_GetPropertyValue_1170874110540(final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"));
}
public static Object referenceMacro_GetReferent_1170295650824(final ReferenceMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"));
}
public static Object referenceMacro_GetReferent_9209581912525278161(final ReferenceMacroContext _context) {
return SNodeOperations.getNodeAncestor(_context.getNode(), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, "jetbrains.mps.baseLanguage.structure.ClassConcept"), false, false);
}
public static Object referenceMacro_GetReferent_1170287949033(final ReferenceMacroContext _context) {
// alternatively, could have used MAP-SRC to findEnclosingClosureContextOwner and template reference
SNode generatedClass = _context.getOutputNodeByInputNodeAndMappingLabel(ClosuresUtil.findEnclosingClosureContextOwner(_context.getNode()), "contextOwner_closureContext_class");
return (generatedClass != null ? generatedClass : SNodeOperations.getNode("6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.lang(JDK/)", "~Object"));
}
public static Object referenceMacro_GetReferent_9209581912525304897(final ReferenceMacroContext _context) {
return SNodeOperations.getNodeAncestor(_context.getNode(), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, "jetbrains.mps.baseLanguage.structure.ClassConcept"), false, false);
}
public static Object referenceMacro_GetReferent_5351366134229433399(final ReferenceMacroContext _context) {
// XXX Why not type of argument but cast?
SNode generatedClass = _context.getOutputNodeByInputNodeAndMappingLabel(ClosuresUtil.findEnclosingClosureContextOwner(_context.getNode()), "contextOwner_closureContext_class");
return (generatedClass != null ? generatedClass : SNodeOperations.getNode("6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.lang(JDK/)", "~Object"));
}
public static Object referenceMacro_GetReferent_9209581912528426692(final ReferenceMacroContext _context) {
return SNodeOperations.getNodeAncestor(_context.getNode(), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, "jetbrains.mps.baseLanguage.structure.ClassConcept"), false, false);
}
public static Object referenceMacro_GetReferent_9209581912525063862(final ReferenceMacroContext _context) {
return SLinkOperations.getTarget(_context.getOutputNodeByInputNodeAndMappingLabel(ClosuresUtil.findEnclosingClosureContextOwner(_context.getNode()), "contextOwner_closureContext_variable"), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7f0L, 0xf8cc67c7f1L, "localVariableDeclaration"));
}
public static Object referenceMacro_GetReferent_1170350646244(final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c77f1e98L, 0xf8cc6bf960L, "variableDeclaration")), "variable_closureContext_classField");
}
public static Object referenceMacro_GetReferent_9209581912525091878(final ReferenceMacroContext _context) {
return SLinkOperations.getTarget(_context.getOutputNodeByInputNodeAndMappingLabel(ClosuresUtil.findEnclosingClosureContextOwner(_context.getNode()), "contextOwner_closureContext_variable"), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7f0L, 0xf8cc67c7f1L, "localVariableDeclaration"));
}
public static Object referenceMacro_GetReferent_1170348563863(final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7f0L, 0xf8cc67c7f1L, "localVariableDeclaration")), "variable_closureContext_classField");
}
public static Object referenceMacro_GetReferent_9209581912525096104(final ReferenceMacroContext _context) {
return SLinkOperations.getTarget(_context.getOutputNodeByInputNodeAndMappingLabel(ClosuresUtil.findEnclosingClosureContextOwner(_context.getNode()), "contextOwner_closureContext_variable"), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7f0L, 0xf8cc67c7f1L, "localVariableDeclaration"));
}
public static Object referenceMacro_GetReferent_1170288676089(final ReferenceMacroContext _context) {
return Sequence.fromIterable(ClassConcept__BehaviorDescriptor.constructors_id4_LVZ3pCvsd.invoke(_context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "closure_adapterClass"))).first();
}
public static Object referenceMacro_GetReferent_1170293907670(final ReferenceMacroContext _context) {
return SPropertyOperations.getString(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x10c7edba8b3L, 0x10c7edc81a4L, "closureParameter")), MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"));
}
public static boolean ifMacro_Condition_9209581912528444488(final IfMacroContext _context) {
return ClosuresUtil.hasVariablesUsedInClosure(ClosuresUtil.findEnclosingClosureContextOwner(_context.getNode()), _context);
}
public static SNode sourceNodeQuery_1170347410888(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x450368d90ce15bc3L, 0x4ed4d318133c80ceL, "type"));
}
public static SNode sourceNodeQuery_1170294125679(final SourceSubstituteMacroNodeContext _context) {
return SNodeOperations.getParent(_context.getNode());
}
public static SNode sourceNodeQuery_1170348623270(final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7f0L, 0xf8cc67c7f1L, "localVariableDeclaration")), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37a7f6eL, 0xf8c37f506eL, "initializer"));
}
public static SNode sourceNodeQuery_1196118817337(final SourceSubstituteMacroNodeContext _context) {
return QueriesUtil.create_enclosingClassObject(_context.getNode());
}
public static Iterable<SNode> sourceNodesQuery_1170347169279(final SourceSubstituteMacroNodesContext _context) {
return ClosuresUtil.getVariablesUsedInClosure(_context.getNode(), _context);
}
public static Iterable<SNode> sourceNodesQuery_5351366134229435466(final SourceSubstituteMacroNodesContext _context) {
return _QueriesUtil.getList_ContextOwner_ifMethod_ParmsUsedInClosure(_context.getNode(), _context);
}
public static Iterable<SNode> sourceNodesQuery_5351366134229435491(final SourceSubstituteMacroNodesContext _context) {
return _QueriesUtil.getList_ContextOwner_ifMethod_ParmsUsedInClosure(_context.getNode(), _context);
}
public static Iterable<SNode> sourceNodesQuery_1170295259476(final SourceSubstituteMacroNodesContext _context) {
return _QueriesUtil.getList_ContextOwner_ifMethod_ParmsUsedInClosure(_context.getNode(), _context);
}
public static Iterable<SNode> sourceNodesQuery_1170294170225(final SourceSubstituteMacroNodesContext _context) {
return SLinkOperations.getChildren(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b200L, 0xf8cc6bf961L, "statement"));
}
public static Iterable<SNode> sourceNodesQuery_1170874089896(final SourceSubstituteMacroNodesContext _context) {
return QueriesUtil.getTypeVars_from_Closure_enclosingClass(_context.getNode());
}
public static SNode weaving_MappingRule_ContextNodeQuery_1186782271334(final WeavingMappingRuleContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "closure_adapterClass");
}
public static boolean mappingConfiguration_Condition_354504345955325245(final TemplateQueryContext _context) {
return SModelOperations.nodes(_context.getInputModel(), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x10c63f4f3f3L, "jetbrains.mps.baseLanguage.structure.Closure")).size() > 0;
}
private final Map<String, ReductionRuleCondition> rrcMethods = new HashMap<String, ReductionRuleCondition>();
{
int i = 0;
rrcMethods.put("1170198230728", new QueriesGenerated.RRC(i++));
rrcMethods.put("1170198477256", new QueriesGenerated.RRC(i++));
rrcMethods.put("1842587602196092387", new QueriesGenerated.RRC(i++));
rrcMethods.put("1170199100495", 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_1170198286262(ctx);
case 1:
return QueriesGenerated.baseMappingRule_Condition_1170198485461(ctx);
case 2:
return QueriesGenerated.baseMappingRule_Condition_1842587602196092389(ctx);
case 3:
return QueriesGenerated.baseMappingRule_Condition_1170199119856(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("1170281770943", new QueriesGenerated.MRRC(i++));
mrrcMethods.put("1170282015273", 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_1170282608160(ctx);
case 1:
return QueriesGenerated.baseMappingRule_Condition_1170282061477(ctx);
default:
throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no condition method for rule %s (key: #%d)", ctx.getTemplateReference(), methodKey));
}
}
}
private final Map<String, QueriesGenerated.WRQ> wrcnMethods = new HashMap<String, QueriesGenerated.WRQ>();
{
int i = 0;
wrcnMethods.put("1170281607835", new QueriesGenerated.WRQ(i++));
}
@Override
@NotNull
public WeaveRuleCondition getWeaveRuleCondition(@NotNull QueryKey identity) {
final String id = identity.getTemplateNode().getNodeId().toString();
if (!(wrcnMethods.containsKey(id))) {
return super.getWeaveRuleCondition(identity);
}
return wrcnMethods.get(id);
}
@Override
@NotNull
public WeaveRuleQuery getWeaveRuleQuery(@NotNull QueryKey identity) {
final String id = identity.getTemplateNode().getNodeId().toString();
if (!(wrcnMethods.containsKey(id))) {
return super.getWeaveRuleQuery(identity);
}
return wrcnMethods.get(id);
}
@NotNull
@Override
public WeaveAnchorQuery getWeaveAnchorQuery(@NotNull QueryKey identity) {
final String id = identity.getTemplateNode().getNodeId().toString();
if (!(wrcnMethods.containsKey(id))) {
return super.getWeaveAnchorQuery(identity);
}
return wrcnMethods.get(id);
}
private static class WRQ implements WeaveRuleQuery, WeaveRuleCondition, WeaveAnchorQuery {
private final int methodKey;
public WRQ(int methodKey) {
this.methodKey = methodKey;
}
@Override
public boolean check(@NotNull WeavingMappingRuleContext ctx) throws GenerationFailureException {
switch (methodKey) {
case 0:
return true;
default:
throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no condition method for rule %s (key: #%d)", ctx.getTemplateReference(), methodKey));
}
}
@Override
public SNode contextNode(WeavingMappingRuleContext ctx) throws GenerationFailureException {
switch (methodKey) {
case 0:
return QueriesGenerated.weaving_MappingRule_ContextNodeQuery_1186782271334(ctx);
default:
throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no context node query method for weaving rule %s (key: #%d)", ctx.getTemplateReference(), methodKey));
}
}
@Nullable
@Override
public SNode anchorNode(WeavingAnchorContext ctx) throws GenerationFailureException {
switch (methodKey) {
case 0:
return null;
default:
throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no anchor query method for rule %s (key: #%d)", ctx.getTemplateReference(), methodKey));
}
}
}
private final Map<String, MapConfigurationCondition> mccMethods = new HashMap<String, MapConfigurationCondition>();
{
int i = 0;
mccMethods.put("1152552359277", new QueriesGenerated.MCC(i++));
}
@Override
@NotNull
public MapConfigurationCondition getMapConfigurationCondition(@NotNull QueryKey identity) {
final String id = identity.getTemplateNode().getNodeId().toString();
if (!(mccMethods.containsKey(id))) {
return super.getMapConfigurationCondition(identity);
}
return mccMethods.get(id);
}
private static class MCC implements MapConfigurationCondition {
private final int methodKey;
public MCC(int methodKey) {
this.methodKey = methodKey;
}
@Override
public boolean check(TemplateQueryContext ctx) throws GenerationFailureException {
switch (methodKey) {
case 0:
return QueriesGenerated.mappingConfiguration_Condition_354504345955325245(ctx);
default:
throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no condition method for map configuration %s (key: #%d)", ctx.getTemplateReference(), methodKey));
}
}
}
private final Map<String, SourceNodeQuery> snqMethods = new HashMap<String, SourceNodeQuery>();
{
int i = 0;
snqMethods.put("1170347410888", new QueriesGenerated.SNQ(i++));
snqMethods.put("1170294125679", new QueriesGenerated.SNQ(i++));
snqMethods.put("1170348623270", new QueriesGenerated.SNQ(i++));
snqMethods.put("1196118817337", 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_1170347410888(ctx);
case 1:
return QueriesGenerated.sourceNodeQuery_1170294125679(ctx);
case 2:
return QueriesGenerated.sourceNodeQuery_1170348623270(ctx);
case 3:
return QueriesGenerated.sourceNodeQuery_1196118817337(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("1170347169279", new QueriesGenerated.SNsQ(i++));
snsqMethods.put("5351366134229435466", new QueriesGenerated.SNsQ(i++));
snsqMethods.put("5351366134229435491", new QueriesGenerated.SNsQ(i++));
snsqMethods.put("1170295259476", new QueriesGenerated.SNsQ(i++));
snsqMethods.put("1170294170225", new QueriesGenerated.SNsQ(i++));
snsqMethods.put("1170874089896", 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_1170347169279(ctx));
case 1:
return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_5351366134229435466(ctx));
case 2:
return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_5351366134229435491(ctx));
case 3:
return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_1170295259476(ctx));
case 4:
return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_1170294170225(ctx));
case 5:
return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_1170874089896(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("1152552655481", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "class_ClosureContext"));
pvqMethods.put("1152553219332", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "_variable_"));
pvqMethods.put("1152725685747", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "_closureContext_"));
pvqMethods.put("1170874110539", new QueriesGenerated.PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "_T_"));
}
@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_1170707207731(ctx);
case 1:
return QueriesGenerated.propertyMacro_GetPropertyValue_1170347597854(ctx);
case 2:
return QueriesGenerated.propertyMacro_GetPropertyValue_1170707554571(ctx);
case 3:
return QueriesGenerated.propertyMacro_GetPropertyValue_1170874110540(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("9209581912528444486", 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_9209581912528444488(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("1152719449385", new QueriesGenerated.RTQ(0, "parm"));
rtqMethods.put("9209581912525278160", new QueriesGenerated.RTQ(1, "Object"));
rtqMethods.put("1152819181376", new QueriesGenerated.RTQ(2, "Object"));
rtqMethods.put("9209581912525304896", new QueriesGenerated.RTQ(3, "Object"));
rtqMethods.put("5351366134229433398", new QueriesGenerated.RTQ(4, "Object"));
rtqMethods.put("9209581912528426691", new QueriesGenerated.RTQ(5, "Object"));
rtqMethods.put("9209581912525063861", new QueriesGenerated.RTQ(6, "_closure_context_"));
rtqMethods.put("1152744782484", new QueriesGenerated.RTQ(7, "_field_"));
rtqMethods.put("9209581912525091877", new QueriesGenerated.RTQ(8, "_closure_context_"));
rtqMethods.put("1152750787501", new QueriesGenerated.RTQ(9, "_field_"));
rtqMethods.put("9209581912525096103", new QueriesGenerated.RTQ(10, "_closureContext"));
rtqMethods.put("1152823755061", new QueriesGenerated.RTQ(11, "stuff_ClosureAdapter"));
rtqMethods.put("1153259374950", new QueriesGenerated.RTQ(12, "_parameter_"));
}
@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_1170295650824(ctx);
case 1:
return QueriesGenerated.referenceMacro_GetReferent_9209581912525278161(ctx);
case 2:
return QueriesGenerated.referenceMacro_GetReferent_1170287949033(ctx);
case 3:
return QueriesGenerated.referenceMacro_GetReferent_9209581912525304897(ctx);
case 4:
return QueriesGenerated.referenceMacro_GetReferent_5351366134229433399(ctx);
case 5:
return QueriesGenerated.referenceMacro_GetReferent_9209581912528426692(ctx);
case 6:
return QueriesGenerated.referenceMacro_GetReferent_9209581912525063862(ctx);
case 7:
return QueriesGenerated.referenceMacro_GetReferent_1170350646244(ctx);
case 8:
return QueriesGenerated.referenceMacro_GetReferent_9209581912525091878(ctx);
case 9:
return QueriesGenerated.referenceMacro_GetReferent_1170348563863(ctx);
case 10:
return QueriesGenerated.referenceMacro_GetReferent_9209581912525096104(ctx);
case 11:
return QueriesGenerated.referenceMacro_GetReferent_1170288676089(ctx);
case 12:
return QueriesGenerated.referenceMacro_GetReferent_1170293907670(ctx);
default:
throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey));
}
}
}
}