Package org.strecks.exceptions

Examples of org.strecks.exceptions.ApplicationRuntimeException


    {
      list.add(clazz.newInstance());
    }
    catch (Exception e)
    {
      throw new ApplicationRuntimeException("Could not instantiate class " + clazz, e);
    }
  }
View Full Code Here


    IntToIntConverter converter = new IntToIntConverter();
    BindSimpleHandler handler = new BindSimpleHandler();
    TargetBean bean = new TargetBean();
    bean.setStringProperty("2");
    ApplicationRuntimeException exception = new ApplicationRuntimeException();

    handler.setConversionHandler(conversionHandler);

    expect(handler.getAndConvertOutwards(bean, "stringProperty", converter)).andThrow(exception);
    replay(conversionHandler);
View Full Code Here

      {

        Class<?>[] parameterTypes = m.getParameterTypes();
        if (parameterTypes.length != 1)
        {
          throw new ApplicationRuntimeException("Method must have one parameter");
        }

        Class type = parameterTypes[0];

        String methodName = m.getName();
        if (!methodName.startsWith("set"))
        {
          throw new ApplicationRuntimeException("Method begin with set");
        }

        Character firstChar = methodName.charAt(3);
        String propertyName = methodName.substring(4);
        propertyName = Character.toLowerCase(firstChar) + propertyName;
View Full Code Here

      });
    }
    catch (Exception e)
    {
      // quite a few exceptions we can have here
      throw new ApplicationRuntimeException("Application error: could not get method " + methodName
          + " from host class " + hostClass.getName());
    }

  }
View Full Code Here

      converter = (Converter) newInstance;
      converter.setTargetClass(propertyType);
    }
    catch (Exception e)
    {
      throw new ApplicationRuntimeException("Could not instantiate class " + converterClass.getName(), e);
    }
    return converter;
  }
View Full Code Here

      Object toTargetType = getConverter().toTargetType(value);
      return toTargetType;
    }
    catch (ConversionException e)
    {
      throw new ApplicationRuntimeException("Conversion failure using " + converter.getClass().getName()
          + " in request parameter handler. This is probably a programming error.", e);
    }
    catch (ClassCastException e)
    {
      Class toConvertType = ReflectHelper.getGenericType(converter.getClass(), Converter.class);

      throw new ApplicationRuntimeException("Converter " + converter.getClass().getName()
          + " is parameterized using type (" + toConvertType
          + "), does not support conversion from String properties");
    }
  }
View Full Code Here

      Class<?> sourceType = PropertyValueGetter.getPropertyTypeSilently(source, sourcePropertyName);

      Type[] genericTypes = ReflectHelper.getGenericTypes(converter.getClass(), Converter.class);
      String description = ReflectHelper.getTypeArrayDescription(genericTypes);

      throw new ApplicationRuntimeException("Mismatch between parameterization type of converter: "
          + converter.getClass().getName() + "(" + description
          + ")), and source type of property being converted: " + source.getClass().getName() + ", property "
          + sourcePropertyName + " (" + sourceType + ")", e);
    }
    catch (ConversionException e)
View Full Code Here

      Class<?> sourceType = PropertyValueGetter.getPropertyTypeSilently(targetBean, propertyName);

      Type[] genericTypes = ReflectHelper.getGenericTypes(converter.getClass(), Converter.class);
      String description = ReflectHelper.getTypeArrayDescription(genericTypes);

      throw new ApplicationRuntimeException("Mismatch between parameterization type of converter: "
          + converter.getClass().getName() + "(" + description
          + ")), and source type of property being converted: " + targetBean.getClass().getName()
          + ", property " + propertyName + " (" + sourceType + ")", e);
    }
    catch (ConversionException e)
View Full Code Here

      final Object newInstance = clazz.newInstance();
      return (DateValidator) newInstance;
    }
    catch (Exception e)
    {
      throw new ApplicationRuntimeException("Unable to create new instance of class "
          + DateValidator.class.getName() + " from class " + clazz.getName(), e);
    }
  }
View Full Code Here

      HttpServletResponse response = actionContext.getResponse();
      view.render(model, request, response);
    }
    catch (Exception e)
    {
      throw new ApplicationRuntimeException("Exception thrown during rendering of view "
          + view.getClass().getName(), e);
    }
  }
View Full Code Here

TOP

Related Classes of org.strecks.exceptions.ApplicationRuntimeException

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.