Package org.araneaframework.core

Examples of org.araneaframework.core.AraneaRuntimeException


    formRowHandler.initAddForm(addForm);
    addWidget("addForm", addForm);   
  }
 
  protected void handleProcess() throws Exception {
    if (rows == null) throw new AraneaRuntimeException("You must set rows before using FormListWidget!");

    for (Iterator i = rows.iterator(); i.hasNext();) {
      Object row = i.next();

      if (formRows.get(formRowHandler.getRowKey(row)) == null)
View Full Code Here


    this.filterForm = new BeanFormWidget(beanClass);
 
 
  private void validateFilterForm() {
    if (this.filterForm == null) {
      throw new AraneaRuntimeException("FilterForm must be set first");
    }
    if (!BeanFormWidget.class.isAssignableFrom(this.filterForm.getClass())) {
      throw new AraneaRuntimeException("FilterForm must be BeanFilterForm");
    }   
  }
View Full Code Here

      fieldId = fullId;
      nextFullId = null;
    }
   
    if (!beanMapper.fieldExists(fieldId)) {
      throw new AraneaRuntimeException("Could not infer type for bean field '" + fullId + "'!");     
    }
   
    if (nextFullId != null) {
      return getBeanFieldType(beanMapper.getBeanFieldType(fieldId), nextFullId)
    }
View Full Code Here

   
    Map entries = new HashMap();
    entries.put(ContinuationContext.class, this);       
    continuation._getComponent().init(new StandardEnvironment(getEnvironment(), entries));
   
    throw new AraneaRuntimeException("Continuation set!");
  }
View Full Code Here

      resetStream();
      try {
        resetWriter();
      }
      catch (UnsupportedEncodingException e) {
        throw new AraneaRuntimeException(e);
      }
    }
View Full Code Here

    if (valueHi.getClass().isAssignableFrom(valueLo.getClass()))
      loExtendsHi = true;
    else if (valueLo.getClass().isAssignableFrom(valueHi.getClass()))
      loExtendsHi = false;
    else
      throw new AraneaRuntimeException("RangeConstraint can be used only with fields of compatible types.");
   
    int comparison = 0// Will be -1, 0 or 1 depending on whether sLo is <, = or > than sHi
   
    // Strings are handled separately because we have to compare them in given locale.
    if (valueLo instanceof String && valueHi instanceof String) {
      Collator collator = Collator.getInstance(); // TODO: Must be locale-specific
      comparison = collator.compare((String)valueLo, (String)valueHi);
    }
    else if (valueLo instanceof Comparable && valueHi instanceof Comparable){    
      if (loExtendsHi)
        comparison = ((Comparable)valueLo).compareTo(valueHi);
      else
        comparison = -1 * ((Comparable)valueHi).compareTo(valueLo);
    }
    else { // Objects are not comparable
      throw new AraneaRuntimeException("RangeConstraint expects fields of Comparable type");
    }
   
    if (comparison > 0 || (!allowEquals && comparison == 0)){
      addError(
          ErrorUtil.localizeAndFormat(
View Full Code Here

   * @param columnName the name of the column to order by.
   * @param ascending whether ordering should be ascending.
   */
  public void setInitialOrder(String columnName, boolean ascending) {
    if (this.listStructure.getColumn(columnName) == null)
      throw new AraneaRuntimeException("Column '" + columnName + "' specified for initial order does not exist!");
   
    OrderInfo orderInfo = new OrderInfo();
    OrderInfoField orderInfoField = new OrderInfoField(columnName, ascending);
    orderInfo.addField(orderInfoField);
    setOrderInfo(orderInfo);
View Full Code Here

   */
  public void addElementAfter(String id, GenericFormElement element, String afterId) throws Exception {
    LinkedMap newElements = new LinkedMap()
     
    if (!getElements().containsKey(afterId))
      throw new AraneaRuntimeException("The element '" + afterId + "' does not exist!");
   
    for (Iterator i = elements.entrySet().iterator(); i.hasNext();) {
        Map.Entry entry = (Map.Entry) i.next();
       
        newElements.put(entry.getKey(), entry.getValue());
View Full Code Here

   */
  public void addElementBefore(String id, GenericFormElement element, String beforeId) throws Exception {
    LinkedMap newElements = new LinkedMap()
   
    if (!elements.containsKey(beforeId))
      throw new AraneaRuntimeException("The element '" + beforeId + "' does not exist!");
     
    for (Iterator i = elements.entrySet().iterator(); i.hasNext();) {
        Map.Entry entry = (Map.Entry) i.next();
       
        if (entry.getKey().equals(beforeId))
View Full Code Here

    try {
      result = voClass.newInstance();
      readFormBean(result);
    }
    catch (InstantiationException e) {
      throw new AraneaRuntimeException("Could not read Value Object from form", e);
    }
    catch (IllegalAccessException e) {
      throw new AraneaRuntimeException("Could not read Value Object from form", e);
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of org.araneaframework.core.AraneaRuntimeException

Copyright © 2018 www.massapicom. 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.