Package org.strecks.exceptions

Examples of org.strecks.exceptions.ApplicationConfigurationException


      if (tempReader != null)
      {
        if (found)
        {
          throw new ApplicationConfigurationException(actionClass.getName()
              + " violates rule that only one method containing an annotation which uses the @"
              + NavigationInfo.class.getSimpleName() + " annotation is permitted");
        }

        ReflectHelper.checkParameterTypeLength(method, 0);

        if (!ReflectHelper.hasReturnValue(method))
        {
          throw new ApplicationConfigurationException(actionClass.getName()
              + " contains an annotation which uses the @" + NavigationInfo.class.getSimpleName()
              + " annotation but returns void");
        }

        reader = tempReader;
View Full Code Here


      NavigationHandlerFactory factoryInstance = new IdentityNavigationHandlerFactory(handler);
      return new NavigationHandlerInfo(factoryInstance, containingMethod);
    }
    else
    {
      throw new ApplicationConfigurationException(actionClass.getName() + ", method "
          + containingMethod.getName() + "(), uses @" + NavigateForward.class.getSimpleName()
          + " annotation with an illegal handler. Must implement either " + NavigationHandler.class.getName()
          + " or " + NavigationHandlerFactory.class.getName());
    }
  }
View Full Code Here

    }

    PropertyDescriptor property = BeanUtils.findPropertyForMethod(getterMethod);
    if (property == null)
    {
      throw new ApplicationConfigurationException("Method " + getterMethod + " is not a valid JavaBean property");
    }
    handler.setPropertyDescriptor(property);
    handler.setConversionHandler(conversionHandler);

    return handler;
View Full Code Here

    PropertyDescriptor property = BeanUtils.findPropertyForMethod(getterMethod);

    if (property == null)
    {
      throw new ApplicationConfigurationException("Method " + getterMethod + " is not a valid JavaBean property");
    }

    handler.setPropertyDescriptor(property);
    handler.setConversionHandler(conversionHandler);
View Full Code Here

    Method setterMethod = ReflectHelper.getSetter(getterMethod);

    if (setterMethod == null)
    {
      throw new ApplicationConfigurationException("Bind annotation used for " + getterMethod
          + " which has no corresponding setter method");
    }

    if (genericType != null)
    {
      Class<?> returnType = getterMethod.getReturnType();

      if (!returnType.equals(genericType))
        throw new ApplicationConfigurationException("Method " + getterMethod
            + " is not type compatible with the type of the converter class " + converterClass.getName()
            + ", which is parameterized with the type " + genericType.getName());

      Class<?> setterParameter = setterMethod.getParameterTypes()[0];
      if (!setterParameter.equals(genericType))
View Full Code Here

  private void checkMethodIsGetter(Method method, Class<? extends Annotation> annotationType)
  {
    if (!ReflectHelper.isGetter(method))
    {
      throw new ApplicationConfigurationException("Invalid @" + annotationType.getSimpleName()
          + " annotation for method " + method + ": annotation only supports getter methods of type String");
    }
  }
View Full Code Here

  {
    WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);

    if (context == null)
    {
      throw new ApplicationConfigurationException(
          "No spring root context found using "
              + "WebApplicationContextUtils.getWebApplicationContext(servletContext). This is probably an application configuration error");
    }

    Object bean = context.getBean(beanName);
    if (bean == null)
    {
      throw new ApplicationConfigurationException("No spring bean " + beanName
          + " found. This is probably an application configuration error");
    }

    return bean;
  }
View Full Code Here

    {
      return new ViewAdapterNavigationHandler();
    }
    else
    {
      throw new ApplicationConfigurationException("Unsupported return type " + returnType.getClass().getName()
          + " for method with @Navigation annotation in class " + beanClassName);
    }
  }
View Full Code Here

  private boolean checkAnnotation(Class actionBeanClass, boolean found, Method method)
  {
    if (found)
    {
      throw new ApplicationConfigurationException(InitMethod.class.getSimpleName()
          + " annotation used more than once in the same class " + actionBeanClass);
    }

    final Class<?>[] parameterTypes = method.getParameterTypes();

    if (parameterTypes != null && parameterTypes.length > 0)
    {
      throw new ApplicationConfigurationException(InitMethod.class.getSimpleName()
          + " annotation used with method " + method + " cannot have parameters");
    }

    final Class<?> returnType = method.getReturnType();
    if (returnType != null && !returnType.equals(Void.TYPE))
    {
      throw new ApplicationConfigurationException(InitMethod.class.getSimpleName()
          + " annotation used with method " + method + " cannot have a return type");
    }

    found = true;
    return found;
View Full Code Here

TOP

Related Classes of org.strecks.exceptions.ApplicationConfigurationException

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.