Package com.trendrr.strest.server.routing

Examples of com.trendrr.strest.server.routing.MatchedRoute


    if (queryIndex != -1) {
      uri = uri.substring(0, queryIndex);
    }
   
   
    MatchedRoute route = matcher.find(uri);
    if (route == null)
      return null;
   
    Class cls = route.getMapping().getCls();

    if (cls == null)
      return null;
    try {
      StrestController controller = (StrestController)Reflection.defaultInstance(cls);
      controller.params.putAll(route.getParams());
      return controller;
    } catch (Exception e) {
      log.error("Caught" ,e);
    }
    return null;
View Full Code Here


    Assert.assertTrue(match(tree, "/test/idmatch/namematch", "test/idmatch/namematch"));
   
  }
 
  protected boolean match(RouteMatcher tree, String route, String expected) {
    MatchedRoute rt = tree.find(route);
    if (rt == null && expected == null)
      return true;
    if (rt == null) {
      log.warn("Route matched was null: " + route);
      return false;
    }
    if (rt.getMapping().getRoute().equals(expected)) {
      return true;
    }
   
    log.warn("Route didn't match: " + route + " GOT: " + rt.getMapping().getRoute() + " EXPECTED: " + expected);
   
    return false;
  }
View Full Code Here

TOP

Related Classes of com.trendrr.strest.server.routing.MatchedRoute

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.