Class StringOption

Direct Known Subclasses:
DomainFileOption, DomainFolderOption

public class StringOption extends AbstractOption<String>
An Option used to specify a String
  • Constructor Details

    • StringOption

      public StringOption(String name, String value, String arg, String group, String stateKey, boolean hidden, String description)
      Creates a new IntegerOption
      Parameters:
      name - the name of the option
      value - the value of the option
      arg - the option's command line argument
      group - the name for group of options
      stateKey - the state key name
      hidden - true if this option should be hidden from the user; otherwise, false
      description - a description of the option
  • Method Details

    • parseAndSetValueByType

      public boolean parseAndSetValueByType(String str, AddressFactory addressFactory)
      Description copied from class: Option
      Set the value for this option by parsing the given string and converting it to the option's type. Fails if this option doesn't have a type associated with it, or if an unsupported type is needed to be parsed.
      Overrides:
      parseAndSetValueByType in class Option
      Parameters:
      str - The value to set, in string form.
      addressFactory - An address factory to use for when the option trying to be set is an Address. If null, an exception will be thrown for Address type options.
      Returns:
      True if the value was successfully parsed and set; otherwise, false.
    • getCustomEditorComponent

      public Component getCustomEditorComponent(AddressFactoryService addressFactoryService)
      Description copied from class: Option
      Override if you want to provide a custom widget for selecting your options.

      Important! If you override this you MUST also override the Option.copy() method so it returns a new instance of your custom editor.

      Overrides:
      getCustomEditorComponent in class Option
      Parameters:
      addressFactoryService - The AddressFactoryService
      Returns:
      the custom editor Component, or null if there isn't one
    • copy

      public StringOption copy()
      Description copied from class: Option
      Returns a copy of this Option object.

      NOTE: Option subclasses should always overwrite this method so they can return their exact type, instead of the more generic Option type.

      NOTE: When the deprecated constructors of this class get removed, this method should become abstract.

      Specified by:
      copy in class AbstractOption<String>
      Returns:
      a copy of this Option object