2 * Copyright 2004-2005 the original author or authors.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org
.codehaus
.groovy
.grails
.web
.mapping
;
21 * Main entry point of Grails URL mapping mechanism. This interface defines methods to match
22 * URLs and create reverse mappings based on the UrlMapping instances the implementor contains
24 * @author Graeme Rocher
28 * Created: Mar 6, 2007
31 public interface UrlMappingsHolder
{
33 String BEAN_ID
= "grailsUrlMappingsHolder";
36 * Retrieves the held UrlMapping instances as an array
38 * @return An array of UrlMapping instances
40 UrlMapping
[] getUrlMappings();
44 * Retrieves the best guess of a URI for the given controller, action and parameters
46 * @param controller The name of the controller
47 * @param action The name of the action or null
48 * @param params The parameters or null
49 * @return A URI for the given arguments
51 UrlCreator
getReverseMapping(String controller
, String action
, Map params
);
54 * Match and return the first UrlMappingInfo instance possible
56 * @param uri The URI to match
57 * @return A UrlMappingInfo or null
59 UrlMappingInfo
match(String uri
);
62 * Matches all possible UrlMappingInfo instances to the given URI and returns them all
64 * @param uri The URI to match
65 * @return An array of 0 or many UrlMappngInfo instances
67 UrlMappingInfo
[] matchAll(String uri
);
70 * Match all possible UrlMappingInfo instances to the given URI and HTTP method
72 * @param uri The URI to match
73 * @param httpMethod The HTTP method (GET,POST,PUT,DELETE etc.)
74 * @return An array of 0 or many UrlMappingInfo instances
76 UrlMappingInfo
[] matchAll(String uri
, String httpMethod
);
79 * Match and return the first UrlMappingInfo instance possible
81 * @param responseCode The responseCode to match
82 * @return A UrlMappingInfo or null
84 UrlMappingInfo
matchStatusCode(int responseCode
);