Exemplo n.º 1
0
  List<String> getLinkHeaderValues(Object entity, UriInfo uriInfo) {
    final List<Object> matchedResources = uriInfo.getMatchedResources();

    if (!matchedResources.isEmpty()) {
      final Object resource = matchedResources.get(0);
      final List<String> headerValues = new ArrayList<String>();

      for (LinkHeaderDescriptor desc : instanceDescriptor.getLinkHeaders()) {
        if (ELLinkBuilder.evaluateCondition(desc.getCondition(), entity, resource, entity)) {
          String headerValue = getLinkHeaderValue(desc, entity, resource, uriInfo);
          headerValues.add(headerValue);
        }
      }
      return headerValues;
    }

    return Collections.emptyList();
  }
Exemplo n.º 2
0
 public HeaderProcessor(Class<T> c) {
   instanceDescriptor = EntityDescriptor.getInstance(c);
 }