Class TemplateCall
- java.lang.Object
 - 
- jetbrains.mps.generator.impl.interpreted.TemplateCall
 
 
- 
public class TemplateCall extends Object
Runtime presentation of a template invocation or call site. Handles arguments, prepares template context for a call. Representsnode<ITemplateCall>. 
- 
- 
Constructor Summary
Constructors Constructor Description TemplateCall(String[] parameterNames, Object[] arguments)Transition from TemplateDeclaration that knows its arguments at construction time to TD that evaluates argument values prior to call and therefore can cache and reuse template runtime nodes (i.e.TemplateCall(SNode templateCall)At the moment, we handle ITemplateCall only, the reference to TemplateDeclaration with accompanying arguments. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanargumentsMismatch()TemplateContextprepareCallContext(TemplateContext outerContext) 
 - 
 
- 
- 
Constructor Detail
- 
TemplateCall
public TemplateCall(@NotNull SNode templateCall)
At the moment, we handle ITemplateCall only, the reference to TemplateDeclaration with accompanying arguments. Elements with references to TemplateDeclaration without arguments (like WeaveEach) shall not get here (although it's not a big deal to handle it here, just keep myArguments empty, and return outerContext unchanged). The reason it's not done here as this knowledge (which consequence is ITemplateCall) is static, and I don't want runtime checks for static knowledge- Parameters:
 templateCall- ITemplateCall node
 
- 
TemplateCall
public TemplateCall(@Nullable String[] parameterNames, @Nullable Object[] arguments)
Transition from TemplateDeclaration that knows its arguments at construction time to TD that evaluates argument values prior to call and therefore can cache and reuse template runtime nodes (i.e. TemplateContainer)- Parameters:
 parameterNames- name of template parameter, if anyarguments- values of template parameters
 
 - 
 
- 
Method Detail
- 
argumentsMismatch
public boolean argumentsMismatch()
- Returns:
 trueiff there are arguments or parameters, but their count doesn't match
 
- 
prepareCallContext
@NotNull public TemplateContext prepareCallContext(@NotNull TemplateContext outerContext) throws GenerationFailureException
- Throws:
 GenerationFailureException
 
 - 
 
 -