|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.mtl.engine.evaluation.MTLEvaluationContext
public final class MTLEvaluationContext
This will hold all necessary variables for the evaluation of an MTL module.
| Constructor Summary | |
|---|---|
MTLEvaluationContext(java.io.File root,
java.util.List<MTLTextGenerationListener> listeners)
Instantiates an evaluation context given the root of the to-be-generated files. |
|
| Method Summary | |
|---|---|
void |
append(java.lang.String string)
Appends the given string to the last buffer of the context stack. |
java.lang.String |
closeContext()
Closes the last writer of the stack and returns its result if it was a StringWriter. |
void |
dispose()
This will be used to dispose of all created buffers. |
java.util.Map<java.lang.String,java.lang.Object> |
getLastVariablesValues()
This will return the last variables that were added to the stack so that they can be restored in the evaluation environment. |
java.lang.String |
getProtectedAreaContent(java.lang.String marker)
This will return the content of the protected area associated with the given marker in the current context. |
void |
openNested()
Creates a new writer and appends it to the end of the stack. |
void |
openNested(java.io.OutputStream stream)
Create a new writer directed at the given OutputStream. |
void |
openNested(java.lang.String filePath,
boolean appendMode)
Create a new writer for the file located at the given path under generationRoot and appends it to the end of the stack. |
void |
saveVariableValues(java.util.Map<java.lang.String,java.lang.Object> vars)
This will save the given variables in the stack. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MTLEvaluationContext(java.io.File root,
java.util.List<MTLTextGenerationListener> listeners)
root - Root of all files that will be generated.listeners - The list of all listeners that are to be notified for text generation from this context.| Method Detail |
|---|
public void append(java.lang.String string)
throws MTLEvaluationException
string - String that is to be appended to the current buffer.
MTLEvaluationException - Thrown if we cannot append to the current buffer.
public java.lang.String closeContext()
throws MTLEvaluationException
MTLEvaluationException - This will be thrown if the last writer of the stack cannot be flushed and closed.
public void dispose()
throws MTLEvaluationException
MTLEvaluationException - Thrown if the disposal of the old writers fails.public java.util.Map<java.lang.String,java.lang.Object> getLastVariablesValues()
public java.lang.String getProtectedAreaContent(java.lang.String marker)
marker - Marker of the sought protected area content.
null if no content
can be found.
public void openNested()
throws MTLEvaluationException
MTLEvaluationException - Thrown if the precedent buffer cannot be flushed.public void openNested(java.io.OutputStream stream)
OutputStream. This is mainly used for fileBlocks with
"stdout" URI.
stream - Stream to which writing will be directed.
public void openNested(java.lang.String filePath,
boolean appendMode)
throws MTLEvaluationException
"file" schemes are handled as absolute paths and will ignore the generationRoot.
filePath - Path of the file around which we need a FileWriter. The file will be created under the
generationRoot if needed.appendMode - If false, the file will be replaced by a new one.
MTLEvaluationException - Thrown if the file cannot be created.public void saveVariableValues(java.util.Map<java.lang.String,java.lang.Object> vars)
vars - Variables which values will need to be restored after evaluation.
|
Copyright 2008 Obeo All Rights Reserved. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||