com.sodius.mdw.core.eval
Interface EvaluationConfiguration

All Known Subinterfaces:
LaunchConfiguration

public interface EvaluationConfiguration

Describes evaluation properties.

Note : template and script designers should generally not have to consider this configuration, which is directly handled by the workbench.

This interface is not intended to be implemented by clients.


Method Summary
 File getEvaluationDirectory()
          Returns the evaluation directory, which determines where to write relative generated files.
 boolean isDebugHierarchyEnabled()
          Returns true if a debug hierarchy must be created during the evaluation.
 boolean isFileOverwriteForced()
          Returns true if generated files must be written out even if their contents is the same as the one on disk.
 void setDebugHierarchyEnabled(boolean value)
          Sets wheter a debug hierarchy should be created during the evaluation.
 void setEvaluationDirectory(File directory)
          Sets the evaluation directory.
 void setFileOverwriteForced(boolean value)
          Specifies wheter generated files must be written on disk even if their contents is the same as the one on disk.
 

Method Detail

getEvaluationDirectory

File getEvaluationDirectory()
Returns the evaluation directory, which determines where to write relative generated files.

This directory is used to resolve the relative path of generated files. For example, if a generation output specifies a file "myOutputFolder\myFile.txt" and if the evaluation directory is "c:\results", then the absolute path will be "c:\results\myOutputFolder\myFile.txt".

It is always a good pratice to specify relative paths in text templates, and let the end-user having the control of where to write the generated files.

Returns:
the evaluation directory (default is the Java system property "user.home").

setEvaluationDirectory

void setEvaluationDirectory(File directory)
Sets the evaluation directory. This evaluation directory may not exist at this time. In that case, it will be created when the first generated file is written out.

Parameters:
directory - the new evaluation directory.
Throws:
IllegalArgumentException - if the directory is not valid (if it is a file for example)

isFileOverwriteForced

boolean isFileOverwriteForced()
Returns true if generated files must be written out even if their contents is the same as the one on disk.

This options has no impact on performances and it is recommended to not overwrite unmodified files when a source configuration management system is used.

Returns:
true if generated files must always be written on disk, false if the engine must first check wheter the contents differs from the one on disk (default is false.

setFileOverwriteForced

void setFileOverwriteForced(boolean value)
Specifies wheter generated files must be written on disk even if their contents is the same as the one on disk.

Parameters:
value - true if generated files must always be written on disk, false if the engine must first check wheter the contents differs from the one on disk.

isDebugHierarchyEnabled

boolean isDebugHierarchyEnabled()
Returns true if a debug hierarchy must be created during the evaluation.

A debug hierarchy keeps track of every evaluated template, rule and script, for debugging purpose. This lets the developer navigate in the evaluation tree once the evaluation is completed.

Returns:
true if a debug hierarchy must be computed, false otherwise (default is false).
See Also:
EvaluationResult.getDebugHierarchy()

setDebugHierarchyEnabled

void setDebugHierarchyEnabled(boolean value)
Sets wheter a debug hierarchy should be created during the evaluation.

A debug hierarchy keeps track of every evaluated template, rule and script, for debugging purpose. This lets the developer navigate in the evaluation tree once the evaluation is completed.

A debug hierarchy comes at a considerable cost in both time and space, and should not be requested frivolously. The additional space is not reclaimed until the debug hierarchy and all its nodes become garbage. So it is very important to not retain any of these objects longer than absolutely necessary

Parameters:
value - determines if a debug hierarchy must be computed