Package jetbrains.mps.generator.impl
Class MapSrcProcessor
- java.lang.Object
 - 
- jetbrains.mps.generator.impl.MapSrcProcessor
 
 
- 
- All Implemented Interfaces:
 NodePostProcessor
- Direct Known Subclasses:
 MapSrcProcessor.MapSrcMacroProcessorInterpreted
public abstract class MapSrcProcessor extends Object implements NodePostProcessor
Default implementation ofNodePostProcessor, with default implementation. Left abstract to stress there's no value in this class unlessNodePostProcessor.substitute()and/orNodePostProcessor.postProcess(SNode)are overridden. 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMapSrcProcessor.MapSrcMacroProcessorInterpretedSupport for substitute/post-process functions in interpreted templates 
- 
Constructor Summary
Constructors Modifier Constructor Description protectedMapSrcProcessor(SNodeReference templateNode, SNode outputAnchor, TemplateContext context) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SNodegetOutputAnchor()TemplateContextgetTemplateContext()SNodeReferencegetTemplateNode()voidpostProcess(SNode outputNode)Default implementation does nothingSNodesubstitute()Default implementation returnsgetOutputAnchor() 
 - 
 
- 
- 
Constructor Detail
- 
MapSrcProcessor
protected MapSrcProcessor(@NotNull SNodeReference templateNode, @NotNull SNode outputAnchor, @NotNull TemplateContext context)
 
 - 
 
- 
Method Detail
- 
getTemplateNode
@NotNull public final SNodeReference getTemplateNode()
- Specified by:
 getTemplateNodein interfaceNodePostProcessor- Returns:
 - pointer to the post-processing origin (e.g. MapSrcMacro) for log/navigation purposes.
 
 
- 
getOutputAnchor
@NotNull public final SNode getOutputAnchor()
- Specified by:
 getOutputAnchorin interfaceNodePostProcessor- Returns:
 - node in output model that is subject to substitute and/or post-processing
 
 
- 
substitute
@NotNull public SNode substitute() throws GenerationFailureException
Default implementation returnsgetOutputAnchor()- Specified by:
 substitutein interfaceNodePostProcessor- Returns:
 - generally shall supply a new node to replace 
output mode. Shall returnNodePostProcessor.getOutputAnchor()to skip the substitution step. - Throws:
 GenerationFailureException
 
- 
postProcess
public void postProcess(@NotNull SNode outputNode) throws GenerationFailureException
Default implementation does nothing- Specified by:
 postProcessin interfaceNodePostProcessor- Parameters:
 outputNode- node in output model to process (outcome ofNodePostProcessor.substitute()call, even if it gaveNodePostProcessor.getOutputAnchor()).- Throws:
 GenerationFailureException
 
- 
getTemplateContext
@NotNull public TemplateContext getTemplateContext()
- Specified by:
 getTemplateContextin interfaceNodePostProcessor- Returns:
 - context this post-processing code has been instantiated in
 
 
 - 
 
 -