Examples of URITemplate


Examples of org.apache.cxf.jaxrs.model.URITemplate

     * @param values template variable values
     * @return updated WebClient
     */
    public WebClient path(String path, Object... values) {
        URI u = UriBuilder.fromUri(URI.create("http://tempuri")).path(path).buildFromEncoded(values);
        getState().setTemplates(getTemplateParametersMap(new URITemplate(path), Arrays.asList(values)));
        return path(u.getRawPath());
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.model.URITemplate

                if (sub1 && !sub2) {
                    return 1;
                } else if (!sub1 && sub2) {
                    return -1;
                }
                URITemplate ut1 = op1.getURITemplate();
                URITemplate ut2 = op2.getURITemplate();
                int result = ut1.getValue().compareTo(ut2.getValue());
                if (result == 0 && !(sub1 && sub2)) {
                    result = op1.getHttpMethod().compareTo(op2.getHttpMethod());
                }
                return result;
            }
View Full Code Here

Examples of org.apache.cxf.jaxrs.model.URITemplate

    }

    private URI doBuild(boolean fromEncoded, Object... values) {
        try {
            String thePath = buildPath(fromEncoded);
            URITemplate pathTempl = new URITemplate(thePath);
            thePath = substituteVarargs(pathTempl, values, 0);
           
            String theQuery = buildQuery(fromEncoded);
            if (theQuery != null) {
                URITemplate queryTempl = new URITemplate(theQuery);
                int lengthDiff = values.length - pathTempl.getVariables().size();
                if (lengthDiff > 0) {
                    theQuery = substituteVarargs(queryTempl, values, values.length - lengthDiff);
                }
            }
View Full Code Here

Examples of org.apache.cxf.jaxrs.model.URITemplate

        }
    }
   
    private String substituteMapped(String path, Map<String, ? extends Object> varValueMap) {
   
        URITemplate templ = new URITemplate(path);
       
        Set<String> uniqueVars = new HashSet<String>(templ.getVariables());
        if (varValueMap.size() < uniqueVars.size()) {
            throw new IllegalArgumentException("Unresolved variables; only " + varValueMap.size()
                                               + " value(s) given for " + uniqueVars.size()
                                               + " unique variable(s)");
        }
        return templ.substitute(varValueMap);
    }
View Full Code Here

Examples of org.atmosphere.util.uri.UriTemplate

        U handler = handlers.get(path);

        if (handler == null) {
            final Map<String, String> m = new HashMap<String, String>();
            for (Map.Entry<String, U> e : handlers.entrySet()) {
                UriTemplate t = null;
                try {
                    t = new UriTemplate(e.getKey());
                    logger.trace("Trying to map {} to {}", t, path);
                    if (t.match(path, m)) {
                        handler = e.getValue();
                        logger.trace("Mapped {} to {}", t, e.getValue());
                        break;
                    }
                } finally {
                    if (t != null) t.destroy();
                }
            }
        }
        return handler;
    }
View Full Code Here

Examples of org.glassfish.jersey.uri.UriTemplate

        for (Resource resource : runtimeResource.getResources()) {

            final Resource parentResource = runtimeResource.getParent() == null
                    ? null : runtimeResource.getParentResources().get(i++);

            final UriTemplate template = resource.getPathPattern().getTemplate();

            final PushMatchedTemplateRouter templateRouter = parentResource == null ?
                    getTemplateRouter(subResourceMode, template, null)
                    : getTemplateRouter(subResourceMode, parentResource.getPathPattern().getTemplate(), template);
View Full Code Here

Examples of org.springframework.hateoas.UriTemplate

   * @return
   */
  public Link appendPaginationParameterTemplates(Link link) {

    Assert.notNull(link, "Link must not be null!");
    return createLink(new UriTemplate(link.getHref()), null, link.getRel());
  }
View Full Code Here

Examples of org.springframework.hateoas.UriTemplate

    for (S element : page) {
      resources.add(assembler.toResource(element));
    }

    UriTemplate base = new UriTemplate(link == null ? getDefaultUriString() : link.getHref());

    PagedResources<R> pagedResources = new PagedResources<R>(resources, asPageMetadata(page));
    pagedResources.add(createLink(base, null, Link.REL_SELF));

    if (page.hasNext()) {
View Full Code Here

Examples of org.springframework.hateoas.UriTemplate

    UriComponents components = builder.build();
    TemplateVariables variables = new TemplateVariables(base.getVariables());
    variables = variables.concat(pageableResolver.getPaginationTemplateVariables(getMethodParameter(), components));

    return new Link(new UriTemplate(components.toString()).with(variables), rel);
  }
View Full Code Here

Examples of org.springframework.web.util.UriTemplate

    if (mapping.length == 0) {
      return builder;
    }

    UriTemplate template = new UriTemplate(mapping[0]);
    return builder.slash(template.expand(parameters));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.