Package jetbrains.mps.text
Class TextGeneratorEngine
- java.lang.Object
 - 
- jetbrains.mps.text.TextGeneratorEngine
 
 
- 
public final class TextGeneratorEngine extends Object
Facility to run parallel text generation for text units given model breaks down to. For the time being, text units correspond to model root nodes, the way it used to be in the past MPS history. Pending API changes to bring control over text units to user and j.m.lang.textgen. Re-work of what used to be jetbrains.mps.generator.textGen.TextGeneratorEngine- Since:
 - 3.3
 
 
- 
- 
Constructor Summary
Constructors Constructor Description TextGeneratorEngine(IMessageHandler messageHandler) 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Future<TextGenResult>generateText(SModel model)Contract: same asschedule(SModel, BlockingQueue)static StringgenerateText(SNode node)PROVISIONAL API INTENDED TO REPLACE TextGen.generateText().voidschedule(SModel model, BlockingQueue<TextGenResult> resultQueue)requires read access Contract: for each model there'd be a TextGenResult instance in the queue (unless interrupted)voidshutdown() 
 - 
 
- 
- 
Constructor Detail
- 
TextGeneratorEngine
public TextGeneratorEngine(@NotNull IMessageHandler messageHandler)
 
 - 
 
- 
Method Detail
- 
shutdown
public void shutdown()
 
- 
generateText
public Future<TextGenResult> generateText(@NotNull SModel model)
Contract: same asschedule(SModel, BlockingQueue)- Parameters:
 model- input for model-to-text transformation- Returns:
 - future result, use 
Future.get()to retrieve 
 
- 
schedule
public void schedule(@NotNull SModel model, @NotNull BlockingQueue<TextGenResult> resultQueue)
requires read access Contract: for each model there'd be a TextGenResult instance in the queue (unless interrupted) might add schedule(SModel):Future<Result> (one more async alternative) and generate(SModel):Result (synchronous alternative)- Parameters:
 model- model to produce text for
 
- 
generateText
public static String generateText(SNode node)
PROVISIONAL API INTENDED TO REPLACE TextGen.generateText(). DO NOT USE OUTSIDE OF MPS. FIXME need better API to deal with outputs other than text Assumes at least read access to node's repository- Parameters:
 node-- Returns:
 - either character data of the outcome, or an error message
 
 
 - 
 
 -