#778 - Introduce LinkRelation and enumerated IANA types.

Include IANA registry text and link to related standard for each link relation.
This commit is contained in:
Greg Turnquist
2019-01-02 23:25:55 -06:00
parent 9c5d10aa07
commit 2e7eabdc1a
9 changed files with 1093 additions and 44 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2017 the original author or authors.
* Copyright 2013-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@ import java.util.Collections;
import java.util.Map;
import java.util.stream.Collectors;
import org.springframework.hateoas.IanaRels;
import org.springframework.hateoas.IanaLinkRelation;
import org.springframework.hateoas.Link;
import org.springframework.hateoas.Links;
import org.springframework.hateoas.UriTemplate;
@@ -35,6 +35,7 @@ import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
*
* @author Oliver Gierke
* @author Jeff Stano
* @author Greg Turnquist
* @since 0.9
*/
public class DefaultCurieProvider implements CurieProvider {
@@ -119,7 +120,7 @@ public class DefaultCurieProvider implements CurieProvider {
@Override
public String getNamespacedRelFor(String rel) {
boolean prefixingNeeded = defaultCurie != null && !IanaRels.isIanaRel(rel) && !rel.contains(":");
boolean prefixingNeeded = defaultCurie != null && !IanaLinkRelation.isIanaRel(rel) && !rel.contains(":");
return prefixingNeeded ? String.format("%s:%s", defaultCurie, rel) : rel;
}