Package br.com.caelum.vraptor

Examples of br.com.caelum.vraptor.VRaptorException


    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


    Method listSetter = ReflectionBasedNullHandler.findMethod(listHolder.getClass(), "set"
        + Info.capitalize(listPropertyName), target.getClass(), null);
    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

    Iterator<Route> matches = Iterators.filter(routes.iterator(), Filters.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

      Object array = arrays.get(setter);
      Object newArray = removeNullsFromArray(array);
      try {
        setter.set(newArray);
      } catch (InvocationTargetException e) {
        throw new VRaptorException(e.getCause());
      } catch (Exception e) {
        throw new IllegalArgumentException(e);
      }
    }
  }
View Full Code Here

    Object current = root;
    for (int i = 1; i < paths.length; i++) {
      try {
        current = navigate(current, paths[i]);
      } catch (Exception e) {
        throw new VRaptorException("Unable to evaluate expression " + path, e);
      }
      if (current == null) {
        return "";
      }
    }
View Full Code Here

      for (int i = 0; i < position; i++) {
        it.next();
      }
      return it.next();
    }
    throw new VRaptorException("Unable to access position of a" + current.getClass().getName() + ".");
  }
View Full Code Here

    try {
      server.start();
      this.port = port;
      LOG.info("VRaptor context started");
    } catch (Exception e) {
      throw new VRaptorException("Unable to start vraptor", e);
    }
  }
View Full Code Here

    if (server.isRunning()) {
      try {
        server.stop();
        LOG.info("VRaptor context stopped");
      } catch (Exception e) {
        throw new VRaptorException("Unable to stop vraptor", 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

    }

    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

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.