Package cu.repsystestbed.parse

Source Code of cu.repsystestbed.parse.CommandLineParser

/*
* THIS IS A GENERATED FILE.  DO NOT EDIT.
*
* JCommando (http://jcommando.sourceforge.net)
*/

package cu.repsystestbed.parse;

import org.jcommando.Command;
import org.jcommando.JCommandParser;
import org.jcommando.Option;
import org.jcommando.Grouping;
import org.jcommando.And;
import org.jcommando.Or;
import org.jcommando.Xor;
import org.jcommando.Not;

/**
* JCommando generated parser class.
*/
public abstract class CommandLineParser extends JCommandParser
{
   /**
     * JCommando generated constructor.
     */
   public CommandLineParser()
   {
      Option alg = new Option();
      alg.setId("alg");
      alg.setShortMnemonic("a");
      alg.setLongMnemonic("alg");
      alg.setDescription("Algorithm");
      alg.setOptionType("String");
      addOption(alg);

      Option graph = new Option();
      graph.setId("graph");
      graph.setShortMnemonic("g");
      graph.setLongMnemonic("graph");
      graph.setDescription("Graph");
      graph.setOptionType("String");
      addOption(graph);

      Option graphtype = new Option();
      graphtype.setId("graphtype");
      graphtype.setShortMnemonic("gt");
      graphtype.setLongMnemonic("graphtype");
      graphtype.setDescription("Graph Type");
      graphtype.setOptionType("String");
      addOption(graphtype);

      Option inputfile = new Option();
      inputfile.setId("inputfile");
      inputfile.setShortMnemonic("i");
      inputfile.setLongMnemonic("inputfile");
      inputfile.setDescription("Input file for the graph");
      inputfile.setOptionType("String");
      addOption(inputfile);

      Option classpath = new Option();
      classpath.setId("classpath");
      classpath.setShortMnemonic("cp");
      classpath.setLongMnemonic("classpath");
      classpath.setDescription("Specify the class path of the algorithm.");
      classpath.setOptionType("String");
      addOption(classpath);

      Command create = new Command();
      create.setName("create");
      create.setId("create");
      create.addOption(alg);
      create.addOption(classpath);
      create.addOption(graph);
      create.addOption(inputfile);
      create.addOption(graphtype);
      create.setGrouping( createCreateGrouping() );
      addCommand(create);

      Command execute = new Command();
      execute.setName("commandless");
      execute.setId("execute");
      execute.setGrouping( createExecuteGrouping() );
      addCommand(execute);

   }

   /**
     * Called by parser to set the 'alg' property.
     *
     * @param alg the value to set.
     */
   public abstract void setAlg(String alg);

   /**
     * Called by parser to set the 'graph' property.
     *
     * @param graph the value to set.
     */
   public abstract void setGraph(String graph);

   /**
     * Called by parser to set the 'graphtype' property.
     *
     * @param graphtype the value to set.
     */
   public abstract void setGraphtype(String graphtype);

   /**
     * Called by parser to set the 'inputfile' property.
     *
     * @param inputfile the value to set.
     */
   public abstract void setInputfile(String inputfile);

   /**
     * Called by parser to set the 'classpath' property.
     *
     * @param classpath the value to set.
     */
   public abstract void setClasspath(String classpath);

   /**
     * Called by parser to perform the 'create' command.
     *
     */
   public abstract void doCreate();

   /**
     * Called by parser to perform the 'execute' command.
     *
     */
   public abstract void doExecute();

   /**
    * Generate the grouping for the 'create' command.
    */
   private Grouping createCreateGrouping()
   {
      And and1 = new And();
      and1.addOption(getOptionById("inputfile"));
      and1.addOption(getOptionById("graphtype"));
      And and2 = new And();
      and2.getGroupings().add(and1);
      and2.addOption(getOptionById("graph"));
      And and3 = new And();
      and3.addOption(getOptionById("classpath"));
      And and4 = new And();
      and4.getGroupings().add(and3);
      and4.addOption(getOptionById("alg"));
      Or or1 = new Or();
      or1.getGroupings().add(and4);
      or1.getGroupings().add(and2);
      return or1;
   }

   /**
    * Generate the grouping for the 'execute' command.
    */
   private Grouping createExecuteGrouping()
   {
      Or or1 = new Or();
      return or1;
   }
}
TOP

Related Classes of cu.repsystestbed.parse.CommandLineParser

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.