Package org.restlet.routing

Examples of org.restlet.routing.Variable


        // Add a route for bookmark resources
        final TemplateRoute uriRoute = router.attach(
                "/users/{username}/bookmarks/{URI}", BookmarkResource.class);
        uriRoute.getTemplate().getVariables().put("URI",
                new Variable(Variable.TYPE_URI_ALL));

        return router;
    }
View Full Code Here


        String entitySet = "{service}.svc/{entitySet}";
        String entity = entitySet + "({keyPredicate})";

        Template t = new Template(entity, Template.MODE_EQUALS);
        t.getVariables().put("entitySet",
                new Variable(Variable.TYPE_ALL, "", true, false));
        t.getVariables().put("keyPredicate",
                new Variable(Variable.TYPE_ALL, "", true, false));

        if (t.match(uri) != -1) {
            return TYPE_ENTITY;
        }
View Full Code Here

   * @param folder
   */
  void attachBrowsing(Context context, Router router, String folder) {
    TemplateRoute route = router.attach("/" + folder + "/{path}", ArtifactsResource.class);
    Map<String, Variable> variables = route.getTemplate().getVariables();
    variables.put("path", new Variable(Variable.TYPE_URI_PATH));   
    router.attach("/" + folder, ArtifactsResource.class);
  }
View Full Code Here

TOP

Related Classes of org.restlet.routing.Variable

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.