Skip to content

Commit

Permalink
Add resource route helper in router (#619)
Browse files Browse the repository at this point in the history
  • Loading branch information
decebals authored Jan 31, 2023
1 parent 3118963 commit 48345bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pippo-core/src/main/java/ro/pippo/core/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/**
* Base class for all Pippo applications.
Expand Down Expand Up @@ -246,7 +247,8 @@ public void setRouter(Router router) {
}

public void setRouter(Router router, boolean preserveOldTransformers) {
if (preserveOldTransformers && (router != null)) {
Objects.requireNonNull(router);
if (preserveOldTransformers && (this.router != null)) {
// preserve route transformers already registered
List<RouteTransformer> transformers = this.router.getRouteTransformers();
transformers.forEach(router::addRouteTransformer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* @author Decebal Suiu
* @author James Moger
*/
public class DefaultRouter implements Router {
public class DefaultRouter implements Router, ResourceRouting {

private static final Logger log = LoggerFactory.getLogger(DefaultRouter.class);

Expand Down

0 comments on commit 48345bc

Please sign in to comment.