Package org.eclipse.epsilon.eol.cli
Class EolConfigParser<C extends EolRunConfiguration,B extends EolRunConfiguration.Builder<C,B>>
java.lang.Object
org.eclipse.epsilon.common.cli.ConfigParser<C,B>
org.eclipse.epsilon.eol.cli.EolConfigParser<C,B>
public class EolConfigParser<C extends EolRunConfiguration,B extends EolRunConfiguration.Builder<C,B>>
extends ConfigParser<C,B>
A default config getter which effectively allows main method inheritance.
Uses reflection to find appropriate constructors and module interface to pass to parseModule method.
Please note: The constructors of this class must be inherited in R!
Note that this needn't be subclassed to use it, you can just add the required projects to the classpath and call it with appropriate arguments, but you must provide a module with the -module option.
Note that this needn't be subclassed to use it, you can just add the required projects to the classpath and call it with appropriate arguments, but you must provide a module with the -module option.
- Since:
- 1.6
- Author:
- Sina Madani
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final String
protected final String
protected final String
protected final String
protected final String
Fields inherited from class org.eclipse.epsilon.common.cli.ConfigParser
builder, cmdLine, help, helpOpt, nL, optionalUsage, options, outFileOpt, profileExecutionOpt, repeatsOpt, requiredUsage, runConfig, scriptOpt, showResultsOpt
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Allows the caller to invoke any subclass of IEolModule.protected void
static Map<IModel,
StringProperties> parseModelParameters
(String[] arguments) protected static <R extends IEolModule>
RparseModule
(String[] args) Attempts to parse a module from command-line arguments, based on assumptions on Epsilon's conventional naming schemes and package structure.parseScriptParameters
(String[] arguments) Methods inherited from class org.eclipse.epsilon.common.cli.ConfigParser
accept, apply, formatUsage, handleException, parseAndRun, tryParse, tryParse, tryParse, tryParse
-
Field Details
-
moduleOpt
- See Also:
-
modelsOpt
- See Also:
-
scriptParamsOpt
- See Also:
-
parallelismOpt
- See Also:
-
sequentialOpt
- See Also:
-
-
Constructor Details
-
EolConfigParser
-
-
Method Details
-
main
Allows the caller to invoke any subclass of IEolModule.- Throws:
ClassNotFoundException
-
parseArgs
- Overrides:
parseArgs
in classConfigParser<C extends EolRunConfiguration,
B extends EolRunConfiguration.Builder<C, B>> - Throws:
Exception
-
parseModelParameters
public static Map<IModel,StringProperties> parseModelParameters(String[] arguments) throws Exception - Throws:
Exception
-
parseScriptParameters
-
parseModule
protected static <R extends IEolModule> R parseModule(String[] args) throws IllegalArgumentException Attempts to parse a module from command-line arguments, based on assumptions on Epsilon's conventional naming schemes and package structure. The names are based on the class name of the return type; so for example for IEolModule, it will use "ERL" as the language and look for the appropriate modules and contexts based on this name.- Parameters:
args
- the name of the module (following org.eclipse.epsilon.) followed by an even-arity array with arguments to provide to the context constructor, where every even numbered argument (including 0) is the class (type) and every odd numbered argument is the value. Note: only types with a String constructor are valid.- Throws:
IllegalArgumentException
-