Class AdditionalOptionsHandlerUtils


  • public class AdditionalOptionsHandlerUtils
    extends Object
    Utility methods for classes implementing the AdditionalOptionsHandler interface.
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    AdditionalOptionsHandler
    • Constructor Detail

      • AdditionalOptionsHandlerUtils

        public AdditionalOptionsHandlerUtils()
    • Method Detail

      • breakUpOptions

        public static AdditionalOptions breakUpOptions​(String optStr,
                                                       Variables vars)
                                                throws Exception
        Breaks up the option string ("key=value [key=value ...]") into key value pairs and returns them in a hashtable.
        Parameters:
        optStr - the option string
        vars - the variables to expand
        Returns:
        the generated key=value relation
        Throws:
        Exception - if parsing of the options fails
      • setOptions

        public static boolean setOptions​(Object obj,
                                         String optStr,
                                         Variables vars)
                                  throws Exception
        Sets the (additional) options, if the provided object implements the AdditionalOptionsHandler interface.
        Parameters:
        obj - the object to set the options for
        optStr - the options string to parse and then set
        vars - the variables to expand
        Returns:
        true if options could be set
        Throws:
        Exception - if parsing of the options failed
        See Also:
        AdditionalOptionsHandler