Package jetbrains.mps.generator.runtime
Interface NodePostProcessor
- 
- All Known Implementing Classes:
 MapSrcProcessor,MapSrcProcessor.MapSrcMacroProcessorInterpreted
public interface NodePostProcessorReplacement forNodeMapper, responsible to replace a node in output model, andPostProcessor, responsible to process node in output model. Combines both under a single interface- Since:
 - 3.3
 
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SNodegetOutputAnchor()TemplateContextgetTemplateContext()SNodeReferencegetTemplateNode()voidpostProcess(SNode outputNode)Counterpart forPostProcessor#process(SNode, TemplateContext)SNodesubstitute()FIXME forcing NotNull seems not the best decision here, as it's generated code and may yield null return value, and it would be nice to handle it gracefully in a single place, rather than failing with NPE Counterpart forNodeMapper#map(SNode, TemplateContext), to replacegetOutputAnchor()with a new node 
 - 
 
- 
- 
Method Detail
- 
getTemplateNode
@NotNull SNodeReference getTemplateNode()
- Returns:
 - pointer to the post-processing origin (e.g. MapSrcMacro) for log/navigation purposes.
 
 
- 
getOutputAnchor
@NotNull SNode getOutputAnchor()
- Returns:
 - node in output model that is subject to substitute and/or post-processing
 
 
- 
getTemplateContext
@NotNull TemplateContext getTemplateContext()
- Returns:
 - context this post-processing code has been instantiated in
 
 
- 
substitute
@NotNull SNode substitute() throws GenerationFailureException
FIXME forcing NotNull seems not the best decision here, as it's generated code and may yield null return value, and it would be nice to handle it gracefully in a single place, rather than failing with NPE Counterpart forNodeMapper#map(SNode, TemplateContext), to replacegetOutputAnchor()with a new node- Returns:
 - generally shall supply a new node to replace 
output mode. Shall returngetOutputAnchor()to skip the substitution step. - Throws:
 GenerationFailureException
 
- 
postProcess
void postProcess(@NotNull SNode outputNode) throws GenerationFailureException
Counterpart forPostProcessor#process(SNode, TemplateContext)- Parameters:
 outputNode- node in output model to process (outcome ofsubstitute()call, even if it gavegetOutputAnchor()).- Throws:
 GenerationFailureException
 
 - 
 
 -