Skip to content

Commit 7ad639c

Browse files
committed
Adapt to change of RelProvider.
1 parent 7b4c385 commit 7ad639c

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

basics/src/main/java/org/springframework/hateoas/examples/SpringHateoasBasicsApplication.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import org.springframework.boot.SpringApplication;
2020
import org.springframework.boot.autoconfigure.SpringBootApplication;
2121
import org.springframework.context.annotation.Bean;
22-
import org.springframework.hateoas.server.core.EvoInflectorRelProvider;
22+
import org.springframework.hateoas.server.core.EvoInflectorLinkRelationProvider;
2323

2424
/**
2525
* @author Greg Turnquist
@@ -37,7 +37,7 @@ public static void main(String... args) {
3737
* @return
3838
*/
3939
@Bean
40-
EvoInflectorRelProvider relProvider() {
41-
return new EvoInflectorRelProvider();
40+
EvoInflectorLinkRelationProvider relProvider() {
41+
return new EvoInflectorLinkRelationProvider();
4242
}
4343
}

commons/src/main/java/org/springframework/hateoas/SimpleIdentifiableRepresentationModelAssembler.java

+15-15
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424

2525
import org.springframework.core.GenericTypeResolver;
2626
import org.springframework.hateoas.server.LinkBuilder;
27-
import org.springframework.hateoas.server.RelProvider;
27+
import org.springframework.hateoas.server.LinkRelationProvider;
2828
import org.springframework.hateoas.server.SimpleRepresentationModelAssembler;
29-
import org.springframework.hateoas.server.core.EvoInflectorRelProvider;
29+
import org.springframework.hateoas.server.core.EvoInflectorLinkRelationProvider;
3030
import org.springframework.hateoas.server.mvc.WebMvcLinkBuilder;
3131
import org.springframework.util.ReflectionUtils;
3232

3333
/**
34-
* A {@link SimpleRepresentationModelAssembler} that mixes together a Spring web controller and a {@link RelProvider} to
35-
* build links upon a certain strategy.
34+
* A {@link SimpleRepresentationModelAssembler} that mixes together a Spring web controller and a
35+
* {@link LinkRelationProvider} to build links upon a certain strategy.
3636
*
3737
* @author Greg Turnquist
3838
*/
@@ -44,9 +44,9 @@ public class SimpleIdentifiableRepresentationModelAssembler<T> implements Simple
4444
private final Class<?> controllerClass;
4545

4646
/**
47-
* A {@link RelProvider} to look up names of links as options for resource paths.
47+
* A {@link LinkRelationProvider} to look up names of links as options for resource paths.
4848
*/
49-
@Getter private final RelProvider relProvider;
49+
@Getter private final LinkRelationProvider relProvider;
5050

5151
/**
5252
* A {@link Class} depicting the object's type.
@@ -59,14 +59,14 @@ public class SimpleIdentifiableRepresentationModelAssembler<T> implements Simple
5959
@Getter @Setter private String basePath = "";
6060

6161
/**
62-
* Default a assembler based on Spring MVC controller, resource type, and {@link RelProvider}. With this combination
63-
* of information, resources can be defined.
62+
* Default a assembler based on Spring MVC controller, resource type, and {@link LinkRelationProvider}. With this
63+
* combination of information, resources can be defined.
6464
*
6565
* @see #setBasePath(String) to adjust base path to something like "/api"/
6666
* @param controllerClass - Spring MVC controller to base links off of
6767
* @param relProvider
6868
*/
69-
public SimpleIdentifiableRepresentationModelAssembler(Class<?> controllerClass, RelProvider relProvider) {
69+
public SimpleIdentifiableRepresentationModelAssembler(Class<?> controllerClass, LinkRelationProvider relProvider) {
7070

7171
this.controllerClass = controllerClass;
7272
this.relProvider = relProvider;
@@ -78,17 +78,17 @@ public SimpleIdentifiableRepresentationModelAssembler(Class<?> controllerClass,
7878
}
7979

8080
/**
81-
* Alternate constructor that falls back to {@link EvoInflectorRelProvider}.
81+
* Alternate constructor that falls back to {@link EvoInflectorLinkRelationProvider}.
8282
*
8383
* @param controllerClass
8484
*/
8585
public SimpleIdentifiableRepresentationModelAssembler(Class<?> controllerClass) {
86-
this(controllerClass, new EvoInflectorRelProvider());
86+
this(controllerClass, new EvoInflectorLinkRelationProvider());
8787
}
8888

8989
/**
9090
* Add single item self link based on the object and link back to aggregate root of the {@literal T} domain type using
91-
* {@link RelProvider#getCollectionResourceRelFor(Class)}}.
91+
* {@link LinkRelationProvider#getCollectionResourceRelFor(Class)}}.
9292
*
9393
* @param resource
9494
*/
@@ -117,9 +117,9 @@ public void addLinks(CollectionModel<EntityModel<T>> resources) {
117117

118118
/**
119119
* Build up a URI for the collection using the Spring web controller followed by the resource type transformed by the
120-
* {@link RelProvider}. Assumption is that an {@literal EmployeeController} serving up {@literal Employee} objects
121-
* will be serving resources at {@code /employees} and {@code /employees/1}. If this is not the case, simply override
122-
* this method in your concrete instance, or resort to overriding {@link #addLinks(EntityModel)} and
120+
* {@link LinkRelationProvider}. Assumption is that an {@literal EmployeeController} serving up {@literal Employee}
121+
* objects will be serving resources at {@code /employees} and {@code /employees/1}. If this is not the case, simply
122+
* override this method in your concrete instance, or resort to overriding {@link #addLinks(EntityModel)} and
123123
* {@link #addLinks(CollectionModel)} where you have full control over exactly what links are put in the individual
124124
* and collection resources.
125125
*

simplified/src/main/java/org/springframework/hateoas/examples/SpringHateoasSimplifiedApplication.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import org.springframework.boot.SpringApplication;
2020
import org.springframework.boot.autoconfigure.SpringBootApplication;
2121
import org.springframework.context.annotation.Bean;
22-
import org.springframework.hateoas.server.core.EvoInflectorRelProvider;
22+
import org.springframework.hateoas.server.core.EvoInflectorLinkRelationProvider;
2323

2424
/**
2525
* @author Greg Turnquist
@@ -37,7 +37,7 @@ public static void main(String... args) {
3737
* @return
3838
*/
3939
@Bean
40-
EvoInflectorRelProvider relProvider() {
41-
return new EvoInflectorRelProvider();
40+
EvoInflectorLinkRelationProvider relProvider() {
41+
return new EvoInflectorLinkRelationProvider();
4242
}
4343
}

0 commit comments

Comments
 (0)