org.hackystat.sensor.xmldata.option
Class OptionHandler

java.lang.Object
  extended by org.hackystat.sensor.xmldata.option.OptionHandler

public class OptionHandler
extends java.lang.Object

The class that handles the options created by the XmlDataController. This class stores, validates, and executes the options.

Author:
aito

Constructor Summary
OptionHandler(XmlDataController controller)
          Constructs this handler with the specified controller.
 
Method Summary
 void addOption(Option option)
          Adds the specified option to this class.
 void clearOptions()
          Clears all of the options managed by this class.
 void execute()
          Executes all of the stored options that have operations to execute on their wrapped parameters.
 boolean hasRequiredOptions()
          Returns true if this class contains all of the required options.
 boolean isOption(java.lang.String argument)
          A helper method that returns true if the specified string is an option.
 boolean isOptionsValid()
          Returns true if all of the options stored in this class are valid and contain no duplicate options.
 void processOptions()
          Processes all of the options wrapped in this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptionHandler

public OptionHandler(XmlDataController controller)
Constructs this handler with the specified controller.

Parameters:
controller - the specified controller.
Method Detail

addOption

public void addOption(Option option)
Adds the specified option to this class. Note that no error checking is performed by this method. Options may be tested by invoking isOptionsValid.

Parameters:
option - the specified option to add.

clearOptions

public void clearOptions()
Clears all of the options managed by this class.


isOptionsValid

public boolean isOptionsValid()
Returns true if all of the options stored in this class are valid and contain no duplicate options. If an option is invalid, an error message is fired by the invalid option.

Returns:
true if the option is valid, false if not.

hasRequiredOptions

public boolean hasRequiredOptions()
Returns true if this class contains all of the required options.

Returns:
true if all required options exist.

isOption

public boolean isOption(java.lang.String argument)
A helper method that returns true if the specified string is an option.

Parameters:
argument - the string to test.
Returns:
true if the string is an option, false if not.

processOptions

public void processOptions()
Processes all of the options wrapped in this object.


execute

public void execute()
Executes all of the stored options that have operations to execute on their wrapped parameters.