24
24
25
25
import org .springframework .core .GenericTypeResolver ;
26
26
import org .springframework .hateoas .server .LinkBuilder ;
27
- import org .springframework .hateoas .server .RelProvider ;
27
+ import org .springframework .hateoas .server .LinkRelationProvider ;
28
28
import org .springframework .hateoas .server .SimpleRepresentationModelAssembler ;
29
- import org .springframework .hateoas .server .core .EvoInflectorRelProvider ;
29
+ import org .springframework .hateoas .server .core .EvoInflectorLinkRelationProvider ;
30
30
import org .springframework .hateoas .server .mvc .WebMvcLinkBuilder ;
31
31
import org .springframework .util .ReflectionUtils ;
32
32
33
33
/**
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.
36
36
*
37
37
* @author Greg Turnquist
38
38
*/
@@ -44,9 +44,9 @@ public class SimpleIdentifiableRepresentationModelAssembler<T> implements Simple
44
44
private final Class <?> controllerClass ;
45
45
46
46
/**
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.
48
48
*/
49
- @ Getter private final RelProvider relProvider ;
49
+ @ Getter private final LinkRelationProvider relProvider ;
50
50
51
51
/**
52
52
* A {@link Class} depicting the object's type.
@@ -59,14 +59,14 @@ public class SimpleIdentifiableRepresentationModelAssembler<T> implements Simple
59
59
@ Getter @ Setter private String basePath = "" ;
60
60
61
61
/**
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.
64
64
*
65
65
* @see #setBasePath(String) to adjust base path to something like "/api"/
66
66
* @param controllerClass - Spring MVC controller to base links off of
67
67
* @param relProvider
68
68
*/
69
- public SimpleIdentifiableRepresentationModelAssembler (Class <?> controllerClass , RelProvider relProvider ) {
69
+ public SimpleIdentifiableRepresentationModelAssembler (Class <?> controllerClass , LinkRelationProvider relProvider ) {
70
70
71
71
this .controllerClass = controllerClass ;
72
72
this .relProvider = relProvider ;
@@ -78,17 +78,17 @@ public SimpleIdentifiableRepresentationModelAssembler(Class<?> controllerClass,
78
78
}
79
79
80
80
/**
81
- * Alternate constructor that falls back to {@link EvoInflectorRelProvider }.
81
+ * Alternate constructor that falls back to {@link EvoInflectorLinkRelationProvider }.
82
82
*
83
83
* @param controllerClass
84
84
*/
85
85
public SimpleIdentifiableRepresentationModelAssembler (Class <?> controllerClass ) {
86
- this (controllerClass , new EvoInflectorRelProvider ());
86
+ this (controllerClass , new EvoInflectorLinkRelationProvider ());
87
87
}
88
88
89
89
/**
90
90
* 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)}}.
92
92
*
93
93
* @param resource
94
94
*/
@@ -117,9 +117,9 @@ public void addLinks(CollectionModel<EntityModel<T>> resources) {
117
117
118
118
/**
119
119
* 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
123
123
* {@link #addLinks(CollectionModel)} where you have full control over exactly what links are put in the individual
124
124
* and collection resources.
125
125
*
0 commit comments