GRAILS-1019: Allowing expressions to be used with the 'disabled' attribute for g...
[grails.git] / src / web / org / codehaus / groovy / grails / web / mapping / UrlMappingsHolder.java
blob33f6ec1b9ef75f375107b7045c7ebd1e7616264f
1 /*
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;
18 import java.util.Map;
20 /**
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
25 * @since 0.5
27 * <p/>
28 * Created: Mar 6, 2007
29 * Time: 8:03:25 AM
31 public interface UrlMappingsHolder {
33 String BEAN_ID = "grailsUrlMappingsHolder";
35 /**
36 * Retrieves the held UrlMapping instances as an array
38 * @return An array of UrlMapping instances
40 UrlMapping[] getUrlMappings();
43 /**
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);
53 /**
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);
61 /**
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);
69 /**
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);
78 /**
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);