Clean up constructors. Use a primary constructor and only do assignments.
Complete Javadoc
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/ecl/SimpleEclExecutor.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/ecl/SimpleEclExecutor.java
index c3db5d9..579ea71 100644
--- a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/ecl/SimpleEclExecutor.java
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/ecl/SimpleEclExecutor.java
@@ -29,24 +29,37 @@
import org.slf4j.LoggerFactory;
/**
- * The ECL executor
+ * The ECL executor.
+ *
* @author Sina Madani
* @since 1.6
*/
public class SimpleEclExecutor implements EpsilonLanguageExecutor<MatchTrace> {
static final Logger logger = LoggerFactory.getLogger(SimpleEclExecutor.class);
- private final IEclModule module;
- private final ModuleWrap helper;
+ private final IEclModule module;
+
+ private final ModuleWrap delegate;
+
+ /**
+ * Instantiates a new simple ECL executor that uses an {@link EclModule} as its module.
+ * @ee {@link EclModule}
+ */
public SimpleEclExecutor() {
this(new EclModule());
}
+ /**
+ * Instantiates a new simple ECL executor that uses the provided {@link IEclModule}.
+ * @see IEclModule
+ *
+ * @param mdl the ECL module to use
+ */
public SimpleEclExecutor(IEclModule mdl) {
logger.info("Creating the EclExecutor");
module = mdl;
- helper = new ModuleWrap(module);
+ delegate = new ModuleWrap(module);
}
@Override
@@ -56,43 +69,43 @@
}
public boolean parse(File file) throws Exception {
- return helper.parse(file);
+ return delegate.parse(file);
}
public boolean parse(String code) throws Exception {
- return helper.parse(code);
+ return delegate.parse(code);
}
public List<ParseProblem> getParseProblems() {
- return helper.getParseProblems();
+ return delegate.getParseProblems();
}
public void addModels(Collection<IModel> models) {
- helper.addModels(models);
+ delegate.addModels(models);
}
public void addParamters(Map<String, ?> parameters) {
- helper.addParamters(parameters);
+ delegate.addParamters(parameters);
}
public void addNativeTypeDelegates(Collection<IToolNativeTypeDelegate> nativeDelegates) {
- helper.addNativeTypeDelegates(nativeDelegates);
+ delegate.addNativeTypeDelegates(nativeDelegates);
}
public Optional<RuleProfiler> getRuleProfiler() {
- return helper.getRuleProfiler();
+ return delegate.getRuleProfiler();
}
public void disposeModelRepository() {
- helper.disposeModelRepository();
+ delegate.disposeModelRepository();
}
public void clearModelRepository() {
- helper.clearModelRepository();
+ delegate.clearModelRepository();
}
public void dispose() {
- helper.dispose();
+ delegate.dispose();
}
public void preProcess() {
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/egl/SimpleEglExecutor.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/egl/SimpleEglExecutor.java
index 1ae4e25..7bdb08d 100644
--- a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/egl/SimpleEglExecutor.java
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/egl/SimpleEglExecutor.java
@@ -28,28 +28,48 @@
import org.slf4j.LoggerFactory;
/**
- * The EGL executor
+ * The EGL executor.
+ *
* @author Horacio Hoyos Rodriguez
* @since 1.6
*/
public class SimpleEglExecutor implements EpsilonLanguageExecutor<Optional<String>> {
private static final Logger logger = LoggerFactory.getLogger(SimpleEglExecutor.class);
+
private EglTemplateFactoryModuleAdapter module;
- private ModuleWrap helper;
+
+ private ModuleWrap delegate;
+ /**
+ * Instantiates a new simple EGL executor that uses an {@link EglTemplateFactoryModuleAdapter}
+ * (with an {@link EglTemplateFactory}) as its module.
+ * @see EglTemplateFactoryModuleAdapter
+ * @see EglTemplateFactory
+ */
public SimpleEglExecutor() {
this(new EglTemplateFactoryModuleAdapter(new EglTemplateFactory()));
}
+ /**
+ * Instantiates a new simple EGL executor that uses an {@link EglTemplateFactoryModuleAdapter}
+ * with the provided {@link EglTemplateFactory}
+ *
+ * @param templateFactory the template factory to use
+ */
public SimpleEglExecutor(EglTemplateFactory templateFactory) {
this(new EglTemplateFactoryModuleAdapter(templateFactory));
}
+ /**
+ * Instantiates a new simple EGL executor that uses the provided {@link EglTemplateFactoryModuleAdapter}
+ *
+ * @param mdl the Template Factory Module Adapter to use
+ */
public SimpleEglExecutor(EglTemplateFactoryModuleAdapter mdl) {
logger.info("Creating the EglExecutor");
module = mdl;
- helper = new ModuleWrap(module);
+ delegate = new ModuleWrap(module);
}
@Override
@@ -61,52 +81,52 @@
@Override
public boolean parse(File file) throws Exception {
- return helper.parse(file);
+ return delegate.parse(file);
}
@Override
public boolean parse(String code) throws Exception {
- return helper.parse(code);
+ return delegate.parse(code);
}
@Override
public List<ParseProblem> getParseProblems() {
- return helper.getParseProblems();
+ return delegate.getParseProblems();
}
@Override
public void addModels(Collection<IModel> models) {
- helper.addModels(models);
+ delegate.addModels(models);
}
@Override
public void addParamters(Map<String, ?> parameters) {
- helper.addParamters(parameters);
+ delegate.addParamters(parameters);
}
@Override
public void addNativeTypeDelegates(Collection<IToolNativeTypeDelegate> nativeDelegates) {
- helper.addNativeTypeDelegates(nativeDelegates);
+ delegate.addNativeTypeDelegates(nativeDelegates);
}
@Override
public Optional<RuleProfiler> getRuleProfiler() {
- return helper.getRuleProfiler();
+ return delegate.getRuleProfiler();
}
@Override
public void disposeModelRepository() {
- helper.disposeModelRepository();
+ delegate.disposeModelRepository();
}
@Override
public void clearModelRepository() {
- helper.clearModelRepository();
+ delegate.clearModelRepository();
}
@Override
public void dispose() {
- helper.dispose();
+ delegate.dispose();
}
@Override
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/egl/SimpleEgxExecutor.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/egl/SimpleEgxExecutor.java
index dcdbdc9..544ad4c 100644
--- a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/egl/SimpleEgxExecutor.java
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/egl/SimpleEgxExecutor.java
@@ -29,7 +29,8 @@
import org.slf4j.LoggerFactory;
/**
- * The EGX executor
+ * The EGX executor.
+ *
* @author Horacio Hoyos Rodriguez
* @since 1.6
*/
@@ -37,20 +38,38 @@
private static final Logger logger = LoggerFactory.getLogger(SimpleEgxExecutor.class);
private IEgxModule module;
- private ModuleWrap helper;
+ private ModuleWrap delegate;
+ /**
+ * Instantiates a new simple EGX executor that uses an {@link EgxModule} as its module.
+ * @see EgxModule
+ */
public SimpleEgxExecutor() {
this(new EgxModule());
}
+ /**
+ * Instantiates a new simple EGX executor that uses the provided {@link EglTemplateFactory}
+ * to create a new {@link EgxModule} to use as its module
+ * @see EglTemplateFactory
+ * @see EgxModule
+ *
+ * @param templateFactory the template factory to use
+ */
public SimpleEgxExecutor(EglTemplateFactory templateFactory) {
this(new EgxModule(templateFactory));
}
+ /**
+ * Instantiates a new simple EGX executor with the provided {@link IEgxModule}.
+ * @see IEgxModule
+ *
+ * @param mdl the module
+ */
public SimpleEgxExecutor(IEgxModule mdl) {
logger.info("Creating the EgxExecutor");
module = mdl;
- helper = new ModuleWrap(module);
+ delegate = new ModuleWrap(module);
}
@Override
@@ -60,43 +79,43 @@
}
public boolean parse(File file) throws Exception {
- return helper.parse(file);
+ return delegate.parse(file);
}
public boolean parse(String code) throws Exception {
- return helper.parse(code);
+ return delegate.parse(code);
}
public List<ParseProblem> getParseProblems() {
- return helper.getParseProblems();
+ return delegate.getParseProblems();
}
public void addModels(Collection<IModel> models) {
- helper.addModels(models);
+ delegate.addModels(models);
}
public void addParamters(Map<String, ?> parameters) {
- helper.addParamters(parameters);
+ delegate.addParamters(parameters);
}
public void addNativeTypeDelegates(Collection<IToolNativeTypeDelegate> nativeDelegates) {
- helper.addNativeTypeDelegates(nativeDelegates);
+ delegate.addNativeTypeDelegates(nativeDelegates);
}
public Optional<RuleProfiler> getRuleProfiler() {
- return helper.getRuleProfiler();
+ return delegate.getRuleProfiler();
}
public void disposeModelRepository() {
- helper.disposeModelRepository();
+ delegate.disposeModelRepository();
}
public void clearModelRepository() {
- helper.clearModelRepository();
+ delegate.clearModelRepository();
}
public void dispose() {
- helper.dispose();
+ delegate.dispose();
}
public void preProcess() {
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/eml/SimpleEmlExecutor.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/eml/SimpleEmlExecutor.java
index b606742..838d748 100644
--- a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/eml/SimpleEmlExecutor.java
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/eml/SimpleEmlExecutor.java
@@ -29,7 +29,7 @@
import org.slf4j.LoggerFactory;
/**
- * The EML executor
+ * The EML executor.
*
* @author Horacio Hoyos Rodriguez
* @since 1.6
@@ -38,16 +38,26 @@
private static final Logger logger = LoggerFactory.getLogger(SimpleEmlExecutor.class);
private IEtlModule module;
- private ModuleWrap helper;
+ private ModuleWrap delegate;
+ /**
+ * Instantiates a new simple EML executor that uses an {@link EtlModule} as its module.
+ * @see EtlModule
+ */
public SimpleEmlExecutor() {
this(new EtlModule());
}
+ /**
+ * Instantiates a new simple EML executor that uses the provided {@link IEtlModule} as its module.
+ * @see IEtlModule
+ *
+ * @param mdl the module
+ */
public SimpleEmlExecutor(IEtlModule mdl) {
logger.info("Creating the EtlExecutor");
module = mdl;
- helper = new ModuleWrap(module);
+ delegate = new ModuleWrap(module);
}
@Override
@@ -58,43 +68,43 @@
}
public boolean parse(File file) throws Exception {
- return helper.parse(file);
+ return delegate.parse(file);
}
public boolean parse(String code) throws Exception {
- return helper.parse(code);
+ return delegate.parse(code);
}
public List<ParseProblem> getParseProblems() {
- return helper.getParseProblems();
+ return delegate.getParseProblems();
}
public void addModels(Collection<IModel> models) {
- helper.addModels(models);
+ delegate.addModels(models);
}
public void addParamters(Map<String, ?> parameters) {
- helper.addParamters(parameters);
+ delegate.addParamters(parameters);
}
public void addNativeTypeDelegates(Collection<IToolNativeTypeDelegate> nativeDelegates) {
- helper.addNativeTypeDelegates(nativeDelegates);
+ delegate.addNativeTypeDelegates(nativeDelegates);
}
public Optional<RuleProfiler> getRuleProfiler() {
- return helper.getRuleProfiler();
+ return delegate.getRuleProfiler();
}
public void disposeModelRepository() {
- helper.disposeModelRepository();
+ delegate.disposeModelRepository();
}
public void clearModelRepository() {
- helper.clearModelRepository();
+ delegate.clearModelRepository();
}
public void dispose() {
- helper.dispose();
+ delegate.dispose();
}
public void preProcess() {
@@ -106,7 +116,7 @@
}
public boolean equals(Object obj) {
- return helper.equals(obj);
+ return delegate.equals(obj);
}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/eol/SimpleEolExecutor.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/eol/SimpleEolExecutor.java
index 55b0660..798de09 100644
--- a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/eol/SimpleEolExecutor.java
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/eol/SimpleEolExecutor.java
@@ -28,6 +28,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+// TODO: Auto-generated Javadoc
/**
* The EOL executor
*
@@ -49,30 +50,76 @@
private final List<Object> arguments;
private final EolMode mode;
private IEolModule module;
- private ModuleWrap helper;
+ private ModuleWrap delegate;
+ /**
+ * Instantiates a new simple EOL executor that uses an {@link EolModuleParallel} (with one
+ * thread) as its module.
+ * This executor will execute the complete code/script.
+ * @see EolModuleParallel
+ */
public SimpleEolExecutor() {
this(null, Collections.emptyList());
}
+ /**
+ * Instantiates a new simple EOL executor hat uses the provided {@link IEolModule} module.
+ * @see IEolModule
+ *
+ * @param mdl the module
+ */
public SimpleEolExecutor(IEolModule mdl) {
this(null, Collections.emptyList(), mdl);
}
+ /**
+ * Instantiates a new simple EOL executor that uses an {@link EolModuleParallel} (with one
+ * thread) as its module, but that will only execute a single operation within the code/script.
+ * The constructor accepts a list of arguments to pass to the operation, i.e. arguments are
+ * position based.
+ * @see EolModuleParallel
+ *
+ *
+ * @param oprtnNm the name of the operation to invoke
+ * @param arguments the arguments to be passed to the operation (position based).
+ *
+ */
public SimpleEolExecutor(String oprtnNm, List<Object> arguments) {
this(oprtnNm, arguments, 1);
}
+ /**
+ * Instantiates a new simple EOL executor that uses an {@link EolModuleParallel} (with one
+ * thread) as its module, but that will only execute a single operation within the code/script.
+ * The constructor accepts a list of arguments to pass to the operation, i.e. arguments are
+ * position based. Additionally, the number of threads to use can also be specified.
+ * @see EolModuleParallel
+ *
+ * @param oprtnNm the name of the operation to invoke
+ * @param arguments the arguments to be passed to the operation (position based).
+ * @param nmbrThrds the nmbr thrds
+ */
public SimpleEolExecutor(String oprtnNm, List<Object> argmnts, int nmbrThrds) {
this(oprtnNm, argmnts, new EolModuleParallel(nmbrThrds));
}
+ /**
+ * Instantiates a new simple EOL executor that the provided {@link IEolModule} as its module,
+ * but that will only execute a single operation within the code/script.
+ * The constructor accepts a list of arguments to pass to the operation, i.e. arguments are
+ * position based. Additionally, the number of threads to use can also be specified.
+ * @see EolModuleParallel
+ *
+ * @param oprtnNm the name of the operation to invoke
+ * @param arguments the arguments to be passed to the operation (position based).
+ * @param mdl the module
+ */
public SimpleEolExecutor(String oprtnNm, List<Object> argmnts, IEolModule mdl) {
operationName = Optional.ofNullable(oprtnNm);
mode = operationName.isPresent() ? EolMode.OPERATION : EolMode.SCRIPT;
arguments = argmnts;
module = mdl;
- helper = new ModuleWrap(module);
+ delegate = new ModuleWrap(module);
}
@Override
@@ -102,43 +149,43 @@
}
public boolean parse(File file) throws Exception {
- return helper.parse(file);
+ return delegate.parse(file);
}
public boolean parse(String code) throws Exception {
- return helper.parse(code);
+ return delegate.parse(code);
}
public List<ParseProblem> getParseProblems() {
- return helper.getParseProblems();
+ return delegate.getParseProblems();
}
public void addModels(Collection<IModel> models) {
- helper.addModels(models);
+ delegate.addModels(models);
}
public void addParamters(Map<String, ?> parameters) {
- helper.addParamters(parameters);
+ delegate.addParamters(parameters);
}
public void addNativeTypeDelegates(Collection<IToolNativeTypeDelegate> nativeDelegates) {
- helper.addNativeTypeDelegates(nativeDelegates);
+ delegate.addNativeTypeDelegates(nativeDelegates);
}
public Optional<RuleProfiler> getRuleProfiler() {
- return helper.getRuleProfiler();
+ return delegate.getRuleProfiler();
}
public void disposeModelRepository() {
- helper.disposeModelRepository();
+ delegate.disposeModelRepository();
}
public void clearModelRepository() {
- helper.clearModelRepository();
+ delegate.clearModelRepository();
}
public void dispose() {
- helper.dispose();
+ delegate.dispose();
}
public void preProcess() {
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/etl/SimpleEtlExecutor.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/etl/SimpleEtlExecutor.java
index 985a244..0c7202b 100644
--- a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/etl/SimpleEtlExecutor.java
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/etl/SimpleEtlExecutor.java
@@ -38,17 +38,26 @@
private static final Logger logger = LoggerFactory.getLogger(SimpleEtlExecutor.class);
private IEtlModule module;
- private ModuleWrap helper;
+ private ModuleWrap delegate;
+ /**
+ * Instantiates a new simple ETL executor that uses an {@link EtlModule} as its module.
+ * @see EtlModule
+ */
public SimpleEtlExecutor() {
- this(new EtlModule());
-
+ this(new EtlModule());
}
+ /**
+ * Instantiates a new simple ETL executor that uses the provided {@link IEtlModule} as its module.
+ * @see IEtlModule
+ *
+ * @param mdl the module
+ */
public SimpleEtlExecutor(IEtlModule mdl) {
logger.info("Creating the Etl Executor");
module = mdl;
- helper = new ModuleWrap(module);
+ delegate = new ModuleWrap(module);
}
@@ -58,43 +67,43 @@
}
public boolean parse(File file) throws Exception {
- return helper.parse(file);
+ return delegate.parse(file);
}
public boolean parse(String code) throws Exception {
- return helper.parse(code);
+ return delegate.parse(code);
}
public List<ParseProblem> getParseProblems() {
- return helper.getParseProblems();
+ return delegate.getParseProblems();
}
public void addModels(Collection<IModel> models) {
- helper.addModels(models);
+ delegate.addModels(models);
}
public void addParamters(Map<String, ?> parameters) {
- helper.addParamters(parameters);
+ delegate.addParamters(parameters);
}
public void addNativeTypeDelegates(Collection<IToolNativeTypeDelegate> nativeDelegates) {
- helper.addNativeTypeDelegates(nativeDelegates);
+ delegate.addNativeTypeDelegates(nativeDelegates);
}
public Optional<RuleProfiler> getRuleProfiler() {
- return helper.getRuleProfiler();
+ return delegate.getRuleProfiler();
}
public void disposeModelRepository() {
- helper.disposeModelRepository();
+ delegate.disposeModelRepository();
}
public void clearModelRepository() {
- helper.clearModelRepository();
+ delegate.clearModelRepository();
}
public void dispose() {
- helper.dispose();
+ delegate.dispose();
}
public void preProcess() {
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/evl/EvlExecutor.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/evl/EvlExecutor.java
index 16a8b7a..06a5c39 100644
--- a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/evl/EvlExecutor.java
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/evl/EvlExecutor.java
@@ -29,27 +29,55 @@
public interface EvlExecutor extends EpsilonLanguageExecutor<Collection<UnsatisfiedConstraint>> {
/**
- * Send the unsatisfied constraints to the log, using the implementation logger
+ * Send the unsatisfied constraints to the log, using the implementation logger.
+ *
+ * @param unsatisfiedConstraints the unsatisfied constraints
*/
void logUnsatisfied(Collection<UnsatisfiedConstraint> unsatisfiedConstraints);
/**
- * Pretty print the unsatisfied constraints
+ * Pretty print the unsatisfied constraints.
+ *
+ * @param unsatisfiedConstraints the unsatisfied constraints
*/
void printUnsatisfied(Collection<UnsatisfiedConstraint> unsatisfiedConstraints);
/**
- * Pretty print the unsatisfied constraints using the specified printer
+ * Pretty print the unsatisfied constraints using the specified printer.
+ *
+ * @param unsatisfiedConstraints the unsatisfied constraints
+ * @param writer the writer
*/
void printUnsatisfied(Collection<UnsatisfiedConstraint> unsatisfiedConstraints, PrintWriter writer);
+ /**
+ * Gets the constraints found in the code/script
+ *
+ * @return the constraints
+ */
List<Constraint> getConstraints();
+ /**
+ * Gets the constraint contexts found in the code/script
+ *
+ * @return the constraint contexts
+ */
List<ConstraintContext> getConstraintContexts();
+ /**
+ * Gets the constraint context with a given name
+ *
+ * @param name the name
+ * @return the constraint context
+ */
ConstraintContext getConstraintContext(String name);
+ /**
+ * Gets the unsatisfied constraints. This method should be called after execution.
+ *
+ * @return the unsatisfied constraints
+ */
Set<UnsatisfiedConstraint> getUnsatisfiedConstraints();
}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/evl/SimpleEvlExecutor.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/evl/SimpleEvlExecutor.java
index dbfc283..2e1df70 100644
--- a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/evl/SimpleEvlExecutor.java
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/evl/SimpleEvlExecutor.java
@@ -37,7 +37,8 @@
import org.slf4j.LoggerFactory;
/**
- * The EVL executor
+ * The EVL executor.
+ *
* @author Horacio Hoyos Rodriguez
* @since 1.6
*/
@@ -45,30 +46,65 @@
private static final Logger logger = LoggerFactory.getLogger(SimpleEvlExecutor.class);
private final IEvlModule module;
- private ModuleWrap helper;
+ private ModuleWrap delegate;
- public SimpleEvlExecutor(IEvlModule mdl) {
- logger.info("Creating the EvlExecutor");
- module = mdl;
- helper = new ModuleWrap(module);
- }
-
+ /**
+ * Instantiates a new simple EVL executor that uses an {@link EvlModule} as its module and
+ * a {@link CommandLineFixer} as a constraint fixer.
+ * @see EvlModule
+ * @see EvlModule
+ */
public SimpleEvlExecutor() {
- this(false, 0, null);
- }
-
- public SimpleEvlExecutor(IEvlFixer evlFixer) {
- this(false, 0, evlFixer);
- }
-
- public SimpleEvlExecutor(boolean useParallel) {
- this(useParallel, 1, new CommandLineFixer());
+ this(new EvlModule(), new CommandLineFixer());
}
- public SimpleEvlExecutor(boolean useParallel, int parallelism, IEvlFixer evlFixer) {
- this(useParallel ? new EvlModuleParallelElements(parallelism) : new EvlModule());
- module.setUnsatisfiedConstraintFixer(evlFixer);
+ /**
+ * Instantiates a new simple EVL executor that uses an {@link EvlModuleParallelElements} as its
+ * module, with the provided number of threads.
+ *
+ * @param parallelism the parallelism to use
+ */
+ public SimpleEvlExecutor(int parallelism) {
+ this(new EvlModuleParallelElements(parallelism), new CommandLineFixer());
}
+
+ /**
+ * Instantiates a new simple EVL executor that uses an {@link EvlModule} as its module and
+ * the provided {@link IEvlFixer} as a constraint fixer.
+ *
+ * @param evlFixer the fixer to use
+ */
+ public SimpleEvlExecutor(IEvlFixer evlFixer) {
+ this(new EvlModule(), evlFixer);
+ }
+
+ /**
+ * Instantiates a new simple EVL executor that uses an {@link EvlModuleParallelElements} as its
+ * module and the provided {@link IEvlFixer} as a constraint fixer, with the provided number of
+ * threads.
+ *
+ * @param parallelism the parallelism o use
+ * @param evlFixer the fixer to use
+ */
+ public SimpleEvlExecutor(int parallelism, IEvlFixer evlFixer) {
+ this(new EvlModuleParallelElements(parallelism), evlFixer);
+ }
+
+ /**
+ * Instantiates a new simple EVL executor that uses the provided {@link IEvlModule} module and
+ * the provided {@link IEvlFixer} as a constraint fixer.
+ *
+ * @param mdl the module
+ * @param evlFixer the fixer
+ */
+ public SimpleEvlExecutor(IEvlModule mdl, IEvlFixer evlFixer) {
+ logger.info("Creating the EvlExecutor");
+ module = mdl;
+ delegate = new ModuleWrap(module);
+ if (module.getUnsatisfiedConstraintFixer() == null) {
+
+ }
+ }
@Override
public Collection<UnsatisfiedConstraint> execute() throws EolRuntimeException {
@@ -96,43 +132,43 @@
}
public boolean parse(File file) throws Exception {
- return helper.parse(file);
+ return delegate.parse(file);
}
public boolean parse(String code) throws Exception {
- return helper.parse(code);
+ return delegate.parse(code);
}
public List<ParseProblem> getParseProblems() {
- return helper.getParseProblems();
+ return delegate.getParseProblems();
}
public void addModels(Collection<IModel> models) {
- helper.addModels(models);
+ delegate.addModels(models);
}
public void addParamters(Map<String, ?> parameters) {
- helper.addParamters(parameters);
+ delegate.addParamters(parameters);
}
public void addNativeTypeDelegates(Collection<IToolNativeTypeDelegate> nativeDelegates) {
- helper.addNativeTypeDelegates(nativeDelegates);
+ delegate.addNativeTypeDelegates(nativeDelegates);
}
public Optional<RuleProfiler> getRuleProfiler() {
- return helper.getRuleProfiler();
+ return delegate.getRuleProfiler();
}
public void disposeModelRepository() {
- helper.disposeModelRepository();
+ delegate.disposeModelRepository();
}
public void clearModelRepository() {
- helper.clearModelRepository();
+ delegate.clearModelRepository();
}
public void dispose() {
- helper.dispose();
+ delegate.dispose();
}
public void preProcess() {
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/model/ICachedModelBuilder.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/model/ICachedModelBuilder.java
index 080b28a..13a037a 100644
--- a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/model/ICachedModelBuilder.java
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/model/ICachedModelBuilder.java
@@ -21,7 +21,12 @@
* @since 1.6
*/
public interface ICachedModelBuilder<M extends IModel, T extends ICachedModelBuilder<M, T>> extends IModelBuilder<M, T> {
-
+
+ /**
+ * Set the useCache for th emodel
+ * @param useCache
+ * @return
+ */
T useCache(boolean useCache);
}