Defines a URL mapping. A URL mapping is a mapping between a URI such as /book/list and a controller, action and/or id.
A UrlMapping should implement Comparable so that UrlMapping instances can be ordered to allow for precendence rules. In other words the URL /book/list should be matched before /book/* as the wildcard is of lesser precedence. By implementing Comparable this can be allowed for.
Type Params | Return Type | Name and description |
---|---|---|
|
java.lang.Object |
getActionName() Retrieves the action name which is either a groovy.lang.Closure that evaluates the action name at runtime or a java.lang.String that represents the action name |
|
Constrained[] |
getConstraints() |
|
java.lang.Object |
getControllerName() Retrieves the controller name which is either a groovy.lang.Closure that evaluates the controller name at runtime or a java.lang.String that represents the controller name |
|
java.lang.String |
getHttpMethod() The HTTP method this URL mapping applies to. |
|
java.lang.String |
getMappingName() The name of the mapping in case of named URL mapping |
|
java.lang.Object |
getNamespace()
|
|
java.lang.Integer |
getPluginIndex()
|
|
java.lang.Object |
getPluginName() The name of the plugin this URL mapping relates to, if any |
|
java.lang.Object |
getRedirectInfo() The redirect information should be a String or a Map. |
|
UrlMappingData |
getUrlData() Retrieves the UrlMappingData instance that describes this UrlMapping |
|
java.lang.String |
getVersion()
|
|
java.lang.Object |
getViewName() Returns the name of the view to map to |
|
boolean |
hasRuntimeVariable(java.lang.String name) Whether the mapping has a runtime variable with the given name such as "/$foo" |
|
boolean |
isDefinedInPlugin()
|
|
UrlMappingInfo |
match(java.lang.String uri) Matches the given URI and returns an instance of the UrlMappingInfo interface or null if a match couldn't be established |
|
void |
setMappingName(java.lang.String name) Sets the name of the URL mapping |
|
void |
setParameterValues(Map parameterValues) Sets any parameter values that should be populated into the request |
|
void |
setParseRequest(boolean shouldParse) Sets whether this UrlMapping should parse the request |
|
void |
setPluginIndex(int pluginIndex) Sets whether or not the mapping is defined in a plugin. |
Methods inherited from class | Name |
---|---|
interface java.lang.Comparable |
java.lang.Comparable#compareTo(java.lang.Object) |
interface UrlCreator |
createRelativeURL, createRelativeURL, createRelativeURL, createRelativeURL, createRelativeURL, createURL, createURL, createURL, createURL, createURL, createURL, createURL |
Retrieves the action name which is either a groovy.lang.Closure that evaluates the action name at runtime or a java.lang.String that represents the action name
The constraints the apply to this UrlMapping. Each constraint maps to a GString token in a URL mapping in order. For example consider the URL:
/blog/$author/$title/$year?/$month?/$day?
This results in 5 ConstrainedProperty instances called author, title, year, month and day
Retrieves the controller name which is either a groovy.lang.Closure that evaluates the controller name at runtime or a java.lang.String that represents the controller name
The HTTP method this URL mapping applies to. Will be null for all HTTP methods
The name of the mapping in case of named URL mapping
The name of the plugin this URL mapping relates to, if any
The redirect information should be a String or a Map. If it is a String that string is the URI to redirect to. If it is a Map, that Map may contain any entries supported as arguments to the dynamic redirect(Map) method on a controller.
Retrieves the UrlMappingData instance that describes this UrlMapping
Returns the name of the view to map to
Whether the mapping has a runtime variable with the given name such as "/$foo"
name
- The name of the variable
Matches the given URI and returns an instance of the UrlMappingInfo interface or null if a match couldn't be established
uri
- The URI to matchSets the name of the URL mapping
name
- The name of the URL mappingSets any parameter values that should be populated into the request
parameterValues
- The parameter values to setSets whether this UrlMapping should parse the request
shouldParse
- True if it shouldSets whether or not the mapping is defined in a plugin.
pluginIndex
- The index of the plugin that defines this mapping