Examples of ConfigException


Examples of de.odysseus.calyxo.base.conf.ConfigException

    }
  }

  protected void checkMultiple() throws Exception {
    if (groupTag.getGroupModel().isMultiple()) {
      throw new ConfigException("A group of radio buttons cannot be multiple (input must not be an array or an index has to be set)!");
    }
  }
View Full Code Here

Examples of de.odysseus.calyxo.base.conf.ConfigException

        value = clazz.newInstance();
      } else {
        value = constructor.invoke(clazz, loader);
      }
    } catch (Exception e) {
      throw new ConfigException(
        "Could not create object of class " + className + " in " + toInlineString(), e);
    }
    apply(value, loader);
    return value;
  }
View Full Code Here

Examples of de.odysseus.calyxo.base.conf.ConfigException

    FormsSupport support = FormsSupport.getInstance(request);
   
    form = support.getForm(request, action);
    if (form == null) {
      throw new ConfigException("Cannot find form for action'" + action + "'!");
    }
    result = support.getFormResult(request, action);
    if (result == null) {
      data = support.getFormData(request, action, create);
    } else {
View Full Code Here

Examples of de.odysseus.calyxo.base.conf.ConfigException

   * Check if the specified component corresponds to an input in this form.
   */
  public void check(FormComponent component) throws ConfigException {
    FormInput input = form.getFormInput(component.getName());
    if (input == null) {
      throw new ConfigException("Input '" + component.getName() + "' does not exist!");
    }
    if (!input.isArray() && component.getIndex() >= 0) {
      throw new ConfigException("Input '" + component.getName() + "' is not an array, but has an index!");
    }
  }
View Full Code Here

Examples of de.odysseus.calyxo.base.conf.ConfigException

  public String getInputValue(FormComponent component) throws Exception {
    FormInput input = form.getFormInput(component.getName());
    if (input.isArray()) {
      int index = component.getIndex();
      if (index < 0) {
        throw new ConfigException("Input '" + component.getName() + "' has no index");
      }
      if (result != null) {
        FormInputResult inputResult = result.getFormInputResult(component.getName());
        if (index >= inputResult.getSize()) {
          return NOT_AVAILABLE;
View Full Code Here

Examples of de.odysseus.calyxo.base.conf.ConfigException

   * Get value array for specified component.
   */
  public String[] getInputValues(FormComponent component) throws Exception {
    FormInput input = form.getFormInput(component.getName());
    if (!input.isArray()) {
      throw new ConfigException("Input '" + component.getName() + "' is not an array");
    }
    if (result != null) {
      return (String[])result.getFormInputResult(component.getName()).format(request);
    } else if (data != null) {
      return (String[])input.format(request, data);
View Full Code Here

Examples of de.odysseus.calyxo.base.conf.ConfigException

  protected void init() throws Exception {
    super.init();

    selectTag = (SelectTag)findAncestor(SelectTag.class);
    if (selectTag == null) {
      throw new ConfigException("A listoptions tag must be nested in a select tag!");
    }
    if (selectTag.getListModel() == null) {
      throw new ConfigException("A listoptions tag requires a listModel in select tag '" +  selectTag.getName() + "'!");
    }
    if (selection != null && !selectTag.getGroupModel().isSelectionAvailable()) {
      if (selection instanceof String) {
        key = (String)selection;
        if (!selectTag.isSelectable(key)) {
          throw new ConfigException("A selected list option for select '" + selectTag.getName() + "' contains invalid value '" + key + "'!");
        }
      } else if (selection instanceof String[]) {
        String[] strings = (String[])selection;
        if (!selectTag.getGroupModel().isMultiple() && strings.length > 1) {
          throw new ConfigException("A single selection must be of size <= 1 in '" + selectTag.getName() + "'!");
        }
        keys = new HashSet(strings.length);
        for (int i = 0; i < strings.length; i++) {
          if (!selectTag.isSelectable(strings[i])) {
            throw new ConfigException("A selected list option for select '" + selectTag.getName() + "' contains invalid value '" + strings[i] + "'!");
          }
          keys.add(strings[i]);
        }
      } else {
        throw new ConfigException("Unsupported object type in selection: " + keys.getClass() + " (must be String or String[])");
      }
    }

  }
View Full Code Here

Examples of de.odysseus.calyxo.base.conf.ConfigException

    Class clazz = null;
    if (className != null) {
      try {
        clazz = loader.loadClass(className);
      } catch (Exception e) {
        throw new ConfigException("Could not get class in " + toInlineString(), e);
      }
    } else if (value != null) {
      clazz = value.getClass();
    } else {
      throw new ConfigException("Cannot get member from null in " + toInlineString());
    }
    if (method != null) {
      return method.invoke(clazz, value, loader);
    } else {
      return field.get(clazz, value);
View Full Code Here

Examples of de.odysseus.calyxo.base.conf.ConfigException

  }

  protected void checkMultiple() throws Exception {
    if (getContext().isMultiple(this)) {
      if (getValue() == null) {
        throw new ConfigException("An array checkbox requires a value!");
      }
    }
  }
View Full Code Here

Examples of de.odysseus.calyxo.base.conf.ConfigException

   */
  protected void init() throws Exception {
    super.init();

    if (getIndex() >= 0 && size > 1) {
      throw new ConfigException("An indexed selection requires size == 1");
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.