001    package org.hackystat.sensor.xmldata.option;
002    
003    import java.util.List;
004    
005    /**
006     * The common interface between objects that wrap the options and parameters
007     * specified via command-line arguments. Options provide the capability to store
008     * the passed options and arguments, validate the parameters, and execute an
009     * action over the parameters.
010     * @author Austen Ito
011     * 
012     */
013    public interface Option {
014      /**
015       * Returns true if this option's parameters are valid.
016       * @return true if all parameters are valid.
017       */
018      public boolean isValid();
019    
020      /**
021       * Returns the name of this option.
022       * @return the option name.
023       */
024      public String getName();
025    
026      /**
027       * Processes the parameters found in this option. This method is called before
028       * execution and can be used to setup option values or perform pre-execution
029       * processing.
030       */
031      public void process();
032    
033      /**
034       * Returns a list of parameters used to execute this option.
035       * @return the list of parameters.
036       */
037      public List<String> getParameters();
038    
039      /**
040       * Executes this option based on the option name and parameters.
041       */
042      public void execute();
043    }