@@ -26,10 +26,13 @@ private UrlMappings() {
2626 throw new UnsupportedOperationException ();
2727 }
2828
29- public static Predicate <UrlMapping > selector (GrailsActionContext context , String methodName ) {
30- return u -> httpMethodMatches (methodName , u )
31- && controllerMatches (context , u )
32- && actionMatches (context , u );
29+ public static Predicate <UrlMapping > selector (
30+ String logicalControllerName ,
31+ String action ,
32+ String httpMethod ) {
33+ return u -> httpMethodMatches (httpMethod , u )
34+ && controllerMatches (u , logicalControllerName )
35+ && actionMatches (action , u );
3336 }
3437
3538 public static Map <String , String > pathParameters (UrlMapping mapping ) {
@@ -81,28 +84,28 @@ private static ResolvedType resolvedPropertyType(
8184 return resolver .resolve (String .class );
8285 }
8386
84- private static boolean httpMethodMatches (String methodName , UrlMapping urlMapping ) {
85- return anyMethod (methodName ) || Objects .equals (urlMapping .getHttpMethod (), methodName );
87+ private static boolean httpMethodMatches (String httpMethod , UrlMapping urlMapping ) {
88+ return anyMethod (httpMethod ) || Objects .equals (urlMapping .getHttpMethod (), httpMethod );
8689 }
8790
8891 private static boolean anyMethod (String methodName ) {
8992 return Strings .isNullOrEmpty (methodName );
9093 }
9194
92- private static boolean actionMatches (GrailsActionContext context , UrlMapping urlMapping ) {
95+ private static boolean actionMatches (String context , UrlMapping urlMapping ) {
9396 return isWildcardAction (urlMapping ) || explicitAction (context , urlMapping );
9497 }
9598
96- private static boolean explicitAction (GrailsActionContext context , UrlMapping urlMapping ) {
97- return Objects .equals (urlMapping .getActionName (), context . getAction () );
99+ private static boolean explicitAction (String action , UrlMapping urlMapping ) {
100+ return Objects .equals (urlMapping .getActionName (), action );
98101 }
99102
100- private static boolean controllerMatches (GrailsActionContext context , UrlMapping urlMapping ) {
101- return isWildcardController (urlMapping ) || explicitController (urlMapping , context );
103+ private static boolean controllerMatches (UrlMapping urlMapping , String logicalControllerName ) {
104+ return isWildcardController (urlMapping ) || explicitController (urlMapping , logicalControllerName );
102105 }
103106
104- private static boolean explicitController (UrlMapping urlMapping , GrailsActionContext context ) {
105- return Objects .equals (urlMapping .getControllerName (), context . getController (). getLogicalPropertyName () );
107+ private static boolean explicitController (UrlMapping urlMapping , String logicalControllerName ) {
108+ return Objects .equals (urlMapping .getControllerName (), logicalControllerName );
106109 }
107110
108111 private static boolean isWildcardController (UrlMapping urlMapping ) {
0 commit comments