use of org.glassfish.jersey.uri.internal.UriTemplateParser in project jersey by jersey.
the class ELLinkBuilder method buildURI.
/**
* TODO javadoc.
*/
static URI buildURI(InjectLinkDescriptor link, Object entity, Object resource, Object instance, UriInfo uriInfo, ResourceMappingContext rmc) {
String template = link.getLinkTemplate(rmc);
// first process any embedded EL expressions
LinkELContext context = new LinkELContext(entity, resource, instance);
ValueExpression expr = expressionFactory.createValueExpression(context, template, String.class);
template = expr.getValue(context).toString();
// now process any embedded URI template parameters
UriBuilder ub = applyLinkStyle(template, link.getLinkStyle(), uriInfo);
UriTemplateParser parser = new UriTemplateParser(template);
List<String> parameterNames = parser.getNames();
Map<String, Object> valueMap = getParameterValues(parameterNames, link, context, uriInfo);
return ub.buildFromMap(valueMap);
}
Aggregations