Class EolConfigParser<C extends EolRunConfiguration,​B extends EolRunConfiguration.Builder<C,​B>>

  • All Implemented Interfaces:
    java.util.function.Consumer<java.lang.String[]>, java.util.function.Function<java.lang.String[],​C>

    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.
    Since:
    1.6
    Author:
    Sina Madani
    • Constructor Detail

      • EolConfigParser

        public EolConfigParser​(B builder)
    • Method Detail

      • main

        public static void main​(java.lang.String... args)
                         throws java.lang.ClassNotFoundException
        Allows the caller to invoke any subclass of IEolModule.
        Throws:
        java.lang.ClassNotFoundException
      • parseModelParameters

        public static java.util.Map<IModel,​StringProperties> parseModelParameters​(java.lang.String[] arguments)
                                                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • parseScriptParameters

        public static java.util.Map<java.lang.String,​java.lang.Object> parseScriptParameters​(java.lang.String[] arguments)
      • parseModule

        protected static <R extends IEolModule> R parseModule​(java.lang.String[] args)
                                                       throws java.lang.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:
        java.lang.IllegalArgumentException