From 7ad639c8751fb28c7b70d23c654c8ff0c40ae078 Mon Sep 17 00:00:00 2001 From: Greg Turnquist Date: Mon, 4 Mar 2019 12:53:24 -0600 Subject: [PATCH] Adapt to change of RelProvider. --- .../SpringHateoasBasicsApplication.java | 6 ++-- ...ntifiableRepresentationModelAssembler.java | 30 +++++++++---------- .../SpringHateoasSimplifiedApplication.java | 6 ++-- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/basics/src/main/java/org/springframework/hateoas/examples/SpringHateoasBasicsApplication.java b/basics/src/main/java/org/springframework/hateoas/examples/SpringHateoasBasicsApplication.java index 8f1e777..1b72c99 100644 --- a/basics/src/main/java/org/springframework/hateoas/examples/SpringHateoasBasicsApplication.java +++ b/basics/src/main/java/org/springframework/hateoas/examples/SpringHateoasBasicsApplication.java @@ -19,7 +19,7 @@ package org.springframework.hateoas.examples; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -import org.springframework.hateoas.server.core.EvoInflectorRelProvider; +import org.springframework.hateoas.server.core.EvoInflectorLinkRelationProvider; /** * @author Greg Turnquist @@ -37,7 +37,7 @@ public class SpringHateoasBasicsApplication { * @return */ @Bean - EvoInflectorRelProvider relProvider() { - return new EvoInflectorRelProvider(); + EvoInflectorLinkRelationProvider relProvider() { + return new EvoInflectorLinkRelationProvider(); } } diff --git a/commons/src/main/java/org/springframework/hateoas/SimpleIdentifiableRepresentationModelAssembler.java b/commons/src/main/java/org/springframework/hateoas/SimpleIdentifiableRepresentationModelAssembler.java index a3662e0..e2e2767 100644 --- a/commons/src/main/java/org/springframework/hateoas/SimpleIdentifiableRepresentationModelAssembler.java +++ b/commons/src/main/java/org/springframework/hateoas/SimpleIdentifiableRepresentationModelAssembler.java @@ -24,15 +24,15 @@ import java.lang.reflect.Field; import org.springframework.core.GenericTypeResolver; import org.springframework.hateoas.server.LinkBuilder; -import org.springframework.hateoas.server.RelProvider; +import org.springframework.hateoas.server.LinkRelationProvider; import org.springframework.hateoas.server.SimpleRepresentationModelAssembler; -import org.springframework.hateoas.server.core.EvoInflectorRelProvider; +import org.springframework.hateoas.server.core.EvoInflectorLinkRelationProvider; import org.springframework.hateoas.server.mvc.WebMvcLinkBuilder; import org.springframework.util.ReflectionUtils; /** - * A {@link SimpleRepresentationModelAssembler} that mixes together a Spring web controller and a {@link RelProvider} to - * build links upon a certain strategy. + * A {@link SimpleRepresentationModelAssembler} that mixes together a Spring web controller and a + * {@link LinkRelationProvider} to build links upon a certain strategy. * * @author Greg Turnquist */ @@ -44,9 +44,9 @@ public class SimpleIdentifiableRepresentationModelAssembler implements Simple private final Class controllerClass; /** - * A {@link RelProvider} to look up names of links as options for resource paths. + * A {@link LinkRelationProvider} to look up names of links as options for resource paths. */ - @Getter private final RelProvider relProvider; + @Getter private final LinkRelationProvider relProvider; /** * A {@link Class} depicting the object's type. @@ -59,14 +59,14 @@ public class SimpleIdentifiableRepresentationModelAssembler implements Simple @Getter @Setter private String basePath = ""; /** - * Default a assembler based on Spring MVC controller, resource type, and {@link RelProvider}. With this combination - * of information, resources can be defined. + * Default a assembler based on Spring MVC controller, resource type, and {@link LinkRelationProvider}. With this + * combination of information, resources can be defined. * * @see #setBasePath(String) to adjust base path to something like "/api"/ * @param controllerClass - Spring MVC controller to base links off of * @param relProvider */ - public SimpleIdentifiableRepresentationModelAssembler(Class controllerClass, RelProvider relProvider) { + public SimpleIdentifiableRepresentationModelAssembler(Class controllerClass, LinkRelationProvider relProvider) { this.controllerClass = controllerClass; this.relProvider = relProvider; @@ -78,17 +78,17 @@ public class SimpleIdentifiableRepresentationModelAssembler implements Simple } /** - * Alternate constructor that falls back to {@link EvoInflectorRelProvider}. + * Alternate constructor that falls back to {@link EvoInflectorLinkRelationProvider}. * * @param controllerClass */ public SimpleIdentifiableRepresentationModelAssembler(Class controllerClass) { - this(controllerClass, new EvoInflectorRelProvider()); + this(controllerClass, new EvoInflectorLinkRelationProvider()); } /** * Add single item self link based on the object and link back to aggregate root of the {@literal T} domain type using - * {@link RelProvider#getCollectionResourceRelFor(Class)}}. + * {@link LinkRelationProvider#getCollectionResourceRelFor(Class)}}. * * @param resource */ @@ -117,9 +117,9 @@ public class SimpleIdentifiableRepresentationModelAssembler implements Simple /** * Build up a URI for the collection using the Spring web controller followed by the resource type transformed by the - * {@link RelProvider}. Assumption is that an {@literal EmployeeController} serving up {@literal Employee} objects - * will be serving resources at {@code /employees} and {@code /employees/1}. If this is not the case, simply override - * this method in your concrete instance, or resort to overriding {@link #addLinks(EntityModel)} and + * {@link LinkRelationProvider}. Assumption is that an {@literal EmployeeController} serving up {@literal Employee} + * objects will be serving resources at {@code /employees} and {@code /employees/1}. If this is not the case, simply + * override this method in your concrete instance, or resort to overriding {@link #addLinks(EntityModel)} and * {@link #addLinks(CollectionModel)} where you have full control over exactly what links are put in the individual * and collection resources. * diff --git a/simplified/src/main/java/org/springframework/hateoas/examples/SpringHateoasSimplifiedApplication.java b/simplified/src/main/java/org/springframework/hateoas/examples/SpringHateoasSimplifiedApplication.java index a107258..2036971 100644 --- a/simplified/src/main/java/org/springframework/hateoas/examples/SpringHateoasSimplifiedApplication.java +++ b/simplified/src/main/java/org/springframework/hateoas/examples/SpringHateoasSimplifiedApplication.java @@ -19,7 +19,7 @@ package org.springframework.hateoas.examples; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -import org.springframework.hateoas.server.core.EvoInflectorRelProvider; +import org.springframework.hateoas.server.core.EvoInflectorLinkRelationProvider; /** * @author Greg Turnquist @@ -37,7 +37,7 @@ public class SpringHateoasSimplifiedApplication { * @return */ @Bean - EvoInflectorRelProvider relProvider() { - return new EvoInflectorRelProvider(); + EvoInflectorLinkRelationProvider relProvider() { + return new EvoInflectorLinkRelationProvider(); } }