/* (non-Javadoc)
@see ca.eandb.util.args.AbstractFieldOption#getOptionValue(java.util.Queue)
972678
@Override
  protected Object getOptionValue(Queue<String> argq) {
    return Float.parseFloat(argq.remove());
  }
1183939
private String getChoiceName(int valueIndex) {

        if (isChoiceHandler()) {
            CmsEntity choice = m_entity.getAttribute(CmsType.CHOICE_ATTRIBUTE_NAME).getComplexValues().get(valueIndex);
            if (choice != null) {
                for (String option : getAttributeType().getAttributeNames()) {
                    if (choice.hasAttribute(option)) {
                        return option;

                    }
                }
            }
        }
        return null;
    }
417880
@Override
    public Object getValue(String name)
    {
        if (arguments == null)
        {
            throw new IllegalStateException("setArgs not called");
        }
        Object ob = options.get(name);
        if (ob != null)
        {
            return ob;
        }
        return arguments.get(name);
    }
404341
public static Option findOption(String name, Option[] options) {
        for (int i = 0; i < options.length; i++) {
            if (options[i].getName().equals(name)) {
                return options[i];
            }
        }
        return null;
    }
109712
def GetValue(self):
    '''
    
    '''
    self.AssertInitialization('Optional')
    value = self._widget.GetValue()
    if not value or len(value) <= 0:
      return None
    return ' '.join(
      [self._action.option_strings[0],  # get the verbose copy if available
       value])
148432
private <T> Option<T> getOption(String parameter) {
        try {
            Field field = UndertowOptions.class.getDeclaredField(parameter);
            if (Option.class.getName().equals(field.getType().getTypeName())) {
                Object value = field.get(null);
                return (Option<T>) value;
            }
        } catch (Exception e) {
            log.debug("getting Option type for parameter {} failed with {}", parameter, e);
        }
        return null;
    }
602762
public String selectedValue() {
        if (isNotPresentSelect()) {
            return null;
        }
        WebElement webElement = element.getWebElement();
        Select dropdown = new Select(webElement);
        WebElement option = dropdown.getFirstSelectedOption();
        return option.getAttribute(VALUE);
    }
892472
public Option defaultValue(String defaultValue) throws RequiredParametersException {
		if (this.choices.isEmpty()) {
			return this.setDefaultValue(defaultValue);
		} else {
			if (this.choices.contains(defaultValue)) {
				return this.setDefaultValue(defaultValue);
			} else {
				throw new RequiredParametersException("Default value " + defaultValue +
						" is not in the list of valid values for option " + this.longName);
			}
		}
	}
276754
public <T> T get(@NonNull String optionName) {
      optionName = optionName.replaceAll("^-+", "");
      NamedOption option = options.get(optionName);

      if (option == null) {
         return Cast.as(unamedOptions.get(optionName));
      }

      if (option.isBoolean()) {
         return option.getValue() == null ? Cast.as(Boolean.FALSE) : option.getValue();
      }

      return option.getValue();
   }
1204332
@Override
    public String getValue(ParsedCommandLine args) {
        try {
            return getValue(args, false);
        } catch (CommandFormatException e) {
            return null;
        }
    }
68138
@Override
    public <T> T getParameterValue(Parameter<T> paramParameter)
    {
        Object value = kunderaQuery.getClauseValue(paramParameter);
        if (value == null)
        {
            throw new IllegalStateException("parameter has not been bound" + paramParameter);
        }
        return (T) value;
    }
802804
@SuppressWarnings("unchecked")
    @Override
    public List<String> getSelectedOptions() throws WidgetException {
        try {
            Object value = getValue();
            if (value != null) {
                if (value instanceof List<?>) {
                    return (List<String>) value;
                } else {
                    List<String> options = new ArrayList<String>();
                    options.add((String) value);
                    return options;
                }
            } else {
                return null;
            }
        } catch (Exception e) {
            throw new WidgetException("Error while fetching selected options", getByLocator(), e);
        }
    }
1036260
public <T> Option<T> findOption(Option<T> option) {
        for (Option candidateOption : options) {
            if (candidateOption.hasSameNameAs(option)) {
                return candidateOption;
            }
        }
        throw new RuntimeException("You tried to set an unexpected option");
    }
1303550
@SuppressWarnings("unchecked")
    public <T> T getOptionValue(String name)
    {
        return (T) configurationOptions.get(name);
    }
561302
public String getOptionValue(final String optionName) {
        if (optionName.length() == 1) {
            return getOptionValue(optionName.charAt(0));
        }
        return (String) commandLine.getValue("--" + optionName);
    }
1185543
@Override
  public Object getValue(final String optionObjectName,
                         final String optionName) throws OptionsException {
    if (useSystemwideValues) {
      // No screwing round with them
      throw new OptionsException("cannot.set.values");
    }

    try {
      /* Find the bean */
      Object opts = getProperty(optionObjectName);

      /* ... and its getter */
      Method meth = findGetter(opts, optionName);

      /* ... now the value */
      return meth.invoke(opts, (Object[])null);
    } catch (OptionsException ce) {
      throw ce;
    } catch (Throwable t) {
      throw new OptionsException(t);
    }
  }
1090714
protected final <O extends AbstractOption<V>, V> V getOrElse0(O option, V defaultValue) {
        return get0(option).orElse(defaultValue);
    }