Package jetbrains.mps.generator.runtime
Interface NodeWeaveFacility
- 
- All Known Implementing Classes:
 NodeWeaveSupport
public interface NodeWeaveFacilityUtility to perform weaving of a node. Context-aware, the only way to obtain its instance isTemplateExecutionEnvironment.prepareWeave(WeaveContext, SNodeReference). Knows parent and anchor for nodes being weaved (either one by one or by means of anothertemplateIt's pretty much just an excerpt fromTemplateExecutionEnvironmenttailored as an intermediate between generated/interpreted weave code and generated/interpreted template. Generally, TEE is intended for use from generated code, interpreted generators generally don't need additional level of indirection TEE brings. OTOH, sometimes it's handy to use same code in both scenarios.- Since:
 - 3.3
 
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceNodeWeaveFacility.WeaveContext 
- 
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description TemplateContextgetTemplateContext()voidweaveNode(SContainmentLink childRole, SNode outputNodeToWeave)Inject new node, with respect to context this facility was created in (i.e.Collection<SNode>weaveTemplate(TemplateDeclaration templateDeclaration)weave template from the same generated generator Method intended for use from generated generators FIXME introduce TEE.prepareWeave(TD):TD along with TEE.prepareApply(TD):TD to support wrapping of TD instances with trace facility from within generated code, then deprecate and drop this oneCollection<SNode>weaveTemplate(SNodeReference templateDeclaration, Object... args)Deprecated. 
 - 
 
- 
- 
Method Detail
- 
getTemplateContext
@NotNull TemplateContext getTemplateContext()
- Returns:
 - context to evaluate templates with.
 
 
- 
weaveNode
void weaveNode(@NotNull SContainmentLink childRole, @NotNull SNode outputNodeToWeave) throws GenerationFailureException
Inject new node, with respect to context this facility was created in (i.e.parent nodeandanchor.- Parameters:
 childRole- role for the childoutputNodeToWeave- new child node- Throws:
 GenerationFailureException
 
- 
weaveTemplate
@Deprecated Collection<SNode> weaveTemplate(@NotNull SNodeReference templateDeclaration, Object... args) throws GenerationException
Deprecated.weave template from another generator Method intended for use from generated generators- Returns:
 - FIXME contract shall be identical to 
TemplateDeclarationWeavingAware2.weave(WeaveContext, NodeWeaveFacility) - Throws:
 GenerationException
 
- 
weaveTemplate
Collection<SNode> weaveTemplate(@NotNull TemplateDeclaration templateDeclaration) throws GenerationException
weave template from the same generated generator Method intended for use from generated generators FIXME introduce TEE.prepareWeave(TD):TD along with TEE.prepareApply(TD):TD to support wrapping of TD instances with trace facility from within generated code, then deprecate and drop this one- Returns:
 - FIXME contract shall be identical to 
TemplateDeclarationWeavingAware2.weave(WeaveContext, NodeWeaveFacility) - Throws:
 GenerationException
 
 - 
 
 -