Package jetbrains.mps.generator.template
Class DefaultQueryExecutionContext
- java.lang.Object
 - 
- jetbrains.mps.generator.template.DefaultQueryExecutionContext
 
 
- 
- All Implemented Interfaces:
 QueryExecutor,QueryExecutionContext
public class DefaultQueryExecutionContext extends Object implements QueryExecutionContext
Default implementation that executes queries without any further activity. XXX Note, evaluate methods account for any trouble in user code, and wrap them withTemplateQueryException. SeeQueryExecutorfor considerations whether we shall keep QE/QEC indirection, or get another GQP provider that would wrap queries with try/catch and unexpected error handling (wrapping could be conditional). I lean towards a distinct provider as it gives more flexibility (can mix different wrappers) and fine-grained control for wrappers like performance tracer. Evgeny Gryaznov, Feb 10, 2010 
- 
- 
Constructor Summary
Constructors Constructor Description DefaultQueryExecutionContext(ITemplateGenerator generator) 
- 
Method Summary
 
 - 
 
- 
- 
Constructor Detail
- 
DefaultQueryExecutionContext
public DefaultQueryExecutionContext(@NotNull ITemplateGenerator generator)
 
 - 
 
- 
Method Detail
- 
evaluate
public boolean evaluate(@NotNull InlineSwitchCaseCondition condition, @NotNull InlineSwitchCaseContext context) throws GenerationFailureException
- Specified by:
 evaluatein interfaceQueryExecutor- Throws:
 GenerationFailureException
 
- 
evaluate
public boolean evaluate(@NotNull IfMacroCondition condition, @NotNull IfMacroContext context) throws GenerationFailureException
- Specified by:
 evaluatein interfaceQueryExecutor- Throws:
 GenerationFailureException
 
- 
evaluate
@Nullable public SNode evaluate(@NotNull MapNodeQuery query, @NotNull MapSrcMacroContext context) throws GenerationFailureException
- Specified by:
 evaluatein interfaceQueryExecutor- Throws:
 GenerationFailureException
 
- 
execute
public void execute(@NotNull MapPostProcessor codeBlock, @NotNull MapSrcMacroPostProcContext context) throws GenerationFailureException
- Specified by:
 executein interfaceQueryExecutor- Throws:
 GenerationFailureException
 
- 
evaluate
@Nullable public Object evaluate(@NotNull PropertyValueQuery query, @NotNull PropertyMacroContext context) throws GenerationFailureException
- Specified by:
 evaluatein interfaceQueryExecutor- Throws:
 GenerationFailureException
 
- 
evaluate
@Nullable public SNode evaluate(@NotNull SourceNodeQuery query, @NotNull SourceSubstituteMacroNodeContext context) throws GenerationFailureException
- Specified by:
 evaluatein interfaceQueryExecutor- Throws:
 GenerationFailureException
 
- 
evaluate
@Nullable public Object evaluate(@NotNull CallArgumentQuery query, @NotNull TemplateArgumentContext context) throws GenerationFailureException
- Specified by:
 evaluatein interfaceQueryExecutor- Throws:
 GenerationFailureException
 
- 
evaluate
@Nullable public Object evaluate(@NotNull VariableValueQuery query, @NotNull TemplateVarContext context) throws GenerationFailureException
- Specified by:
 evaluatein interfaceQueryExecutor- Throws:
 GenerationFailureException
 
- 
evaluate
@NotNull public Collection<SNode> evaluate(@NotNull SourceNodesQuery query, @NotNull SourceSubstituteMacroNodesContext context) throws GenerationFailureException
- Specified by:
 evaluatein interfaceQueryExecutor- Throws:
 GenerationFailureException
 
- 
evaluate
@Nullable public SNode evaluate(@NotNull InsertMacroQuery query, @NotNull InsertMacroContext context) throws GenerationFailureException
- Specified by:
 evaluatein interfaceQueryExecutor- Throws:
 GenerationFailureException
 
- 
evaluate
@Nullable public Object evaluate(@NotNull ReferenceTargetQuery query, @NotNull ReferenceMacroContext context) throws GenerationFailureException
- Specified by:
 evaluatein interfaceQueryExecutor- Throws:
 GenerationFailureException
 
- 
applyRule
public Collection<SNode> applyRule(TemplateReductionRule rule, TemplateContext context) throws GenerationException
- Specified by:
 applyRulein interfaceQueryExecutionContext- Throws:
 GenerationException
 
- 
isApplicable
public boolean isApplicable(@NotNull TemplateRuleWithCondition rule, @NotNull TemplateContext context) throws GenerationFailureException
- Specified by:
 isApplicablein interfaceQueryExecutionContext- Throws:
 GenerationFailureException
 
- 
applyRule
public Collection<SNode> applyRule(TemplateRootMappingRule rule, TemplateContext context) throws GenerationException
- Specified by:
 applyRulein interfaceQueryExecutionContext- Throws:
 GenerationException
 
- 
applyRule
public Collection<SNode> applyRule(TemplateCreateRootRule rule, TemplateExecutionEnvironment environment) throws GenerationException
- Specified by:
 applyRulein interfaceQueryExecutionContext- Throws:
 GenerationException
 
- 
applyRule
public boolean applyRule(TemplateWeavingRule rule, TemplateContext context, SNode outputContextNode) throws GenerationException
- Specified by:
 applyRulein interfaceQueryExecutionContext- Throws:
 GenerationException
 
- 
getContextNode
public SNode getContextNode(TemplateWeavingRule rule, TemplateContext context) throws GenerationFailureException
- Specified by:
 getContextNodein interfaceQueryExecutionContext- Throws:
 GenerationFailureException
 
- 
executeScript
public void executeScript(TemplateMappingScript mappingScript, SModel model) throws GenerationFailureException
- Specified by:
 executeScriptin interfaceQueryExecutionContext- Throws:
 GenerationFailureException
 
 - 
 
 -