Package br.com.caelum.vraptor

Examples of br.com.caelum.vraptor.VRaptorException


      builder.addToMethod(getInstance,new AnnotationLiteral<Produces>() {});
      builder.addToMethod(getInstance,vraptorToCDIScopes.get(scopeInfo.getScope()));     
      return builder;
    }
    catch(Exception exception){
      throw new VRaptorException(exception);
    }
  }
View Full Code Here


    if (matches.hasNext()) {
      try {
        ResourceMethod resourceMethod = DefaultResourceMethod.instanceFor(type, method);
        return matches.next().urlFor(type, method, creator.instanceWithParameters(resourceMethod, 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 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

    }

    public Converter<?> to(Class<?> clazz, Container container) {
        Converter<?> foundConverter = findConverterFor(clazz, container);
        if (foundConverter == null) {
      throw new VRaptorException("Unable to find converter for " + clazz.getName());
    }
        return foundConverter;
    }
View Full Code Here

    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

        }
    }

    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 Converter<?> to(Class<?> clazz) {
        if (!existsFor(clazz)) {
      throw new VRaptorException("Unable to find converter for " + clazz.getName());
    }
        return 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

    if (matches.hasNext()) {
      try {
        ResourceMethod resourceMethod = DefaultResourceMethod.instanceFor(type, method);
        return matches.next().urlFor(type, method, creator.instanceWithParameters(resourceMethod, 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

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.