Package br.com.caelum.vraptor

Examples of br.com.caelum.vraptor.VRaptorException


    Object current = root;
    for (String p : paths) {
      try {
        current = navigate(current, p);
      } catch (InvocationTargetException e) {
        throw new VRaptorException("Unable to evaluate expression " + path, e.getCause());
      } catch (Exception e) {
        throw new VRaptorException("Unable to evaluate expression " + path, e);
      }
      if (current == null) {
        return "";
      }
    }
View Full Code Here


        it.next();
      }
      return it.next();
    }
    String msg = "Unable to access position of a" + current.getClass().getName() + ".";
    throw new InvocationTargetException(new VRaptorException(msg), msg);
  }
View Full Code Here

        }
      }
      try {
        setter.set(newArray);
      } catch (InvocationTargetException e) {
        throw new VRaptorException(e.getCause());
      } catch (Exception e) {
        throw new IllegalArgumentException(e);
      }
    }
  }
View Full Code Here

  public void setEncoding(HttpServletRequest request, HttpServletResponse response) {
    try {
      request.setCharacterEncoding(encoding);
      response.setCharacterEncoding(encoding);
    } catch (UnsupportedEncodingException e) {
      throw new VRaptorException(e);
    }
  }
View Full Code Here

        }
    }

    public void register(Class<? extends Converter<?>> converterClass) {
        if (!converterClass.isAnnotationPresent(Convert.class)) {
            throw new VRaptorException("The converter type " + converterClass.getName()
                    + " should have the Convert annotation");
        }
    classes.addFirst(converterClass);
    }
View Full Code Here

    classes.addFirst(converterClass);
    }

    public <T> Converter<T> to(Class<T> clazz) {
        if (!existsFor(clazz)) {
      throw new VRaptorException("Unable to find converter for " + clazz.getName());
    }
        return (Converter<T>) container.instanceFor(findConverterType(clazz));
    }
View Full Code Here

    return found != null && TwoWayConverter.class.isAssignableFrom(found);
  }

  public TwoWayConverter<?> twoWayConverterFor(Class<?> type) {
    if (!existsTwoWayFor(type)) {
      throw new VRaptorException("Unable to find two way converter for " + type.getName());
    }
        return (TwoWayConverter<?>) container.instanceFor(findConverterType(type));
  }
View Full Code Here

    Iterator<Route> matches = Iterators.filter(routes.iterator(), canHandle(type, method));
    if (matches.hasNext()) {
      try {
        return matches.next().urlFor(type, method, params);
      } catch (Exception e) {
        throw new VRaptorException("The selected route is invalid for redirection: " + type.getName() + "."
            + method.getName(), e);
      }
    }
    throw new RouteNotFoundException("The selected route is invalid for redirection: " + type.getName() + "."
        + method.getName());
View Full Code Here

  public void handle(Class<?> type) {
    if (Interceptor.class.isAssignableFrom(type)) {
            registerInterceptor(type);
        } else {
            throw new VRaptorException("Annotation " + Intercepts.class + " found in " + type
                    + ", but it is neither an Interceptor nor an InterceptorSequence.");
        }
  }
View Full Code Here

      target.getClass());
   
    Type[] types = listSetter.getGenericParameterTypes();
    Type type = types[0];
    if (!(type instanceof ParameterizedType)) {
      throw new VRaptorException("Vraptor does not support non-generic collection at "
          + listSetter.getName());
    }
    return type;
  }
View Full Code Here

TOP

Related Classes of br.com.caelum.vraptor.VRaptorException

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.