Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.groovy.grails.web.mapping
[Java] Class DefaultUrlMappingsHolder

    java.lang.Object
      org.codehaus.groovy.grails.web.mapping.DefaultUrlMappingsHolder

All Implemented Interfaces:
  UrlMappings

    @java.lang.SuppressWarnings("rawtypes")
    public class DefaultUrlMappingsHolder
    extends java.lang.Object

Default implementation of the UrlMappingsHolder interface that takes a list of mappings and then sorts them according to their precedence rules as defined in the implementation of Comparable.

Authors:
  Graeme Rocher

See Also:
  UrlMapping
  java.lang.Comparable

Since:
  0.4

Constructor Summary
`DefaultUrlMappingsHolder(java.util.List mappings)`
`DefaultUrlMappingsHolder(java.util.List mappings, java.util.List excludePatterns)`
`DefaultUrlMappingsHolder(java.util.List mappings, java.util.List excludePatterns, boolean doNotCallInit)`

Method Summary
`java.util.Collection` | `addMappings(groovy.lang.Closure mappings)`
`java.util.Set` | `allowedMethods(java.lang.String uri)`
`java.util.List` | `getExcludePatterns()`
`UrlCreator` | `getReverseMapping(java.lang.String controller, java.lang.String action, java.util.Map params)`
`UrlCreator` | `getReverseMapping(java.lang.String controller, java.lang.String action, java.lang.String pluginName, java.util.Map params)`
`UrlCreator` | `getReverseMapping(java.lang.String controller, java.lang.String action, java.lang.String namespace, java.lang.String pluginName, java.lang.String httpMethod, java.util.Map params)`
`UrlCreator` | `getReverseMapping(java.lang.String controller, java.lang.String action, java.lang.String namespace, java.lang.String pluginName, java.lang.String httpMethod, java.lang.String version, java.util.Map params)`
`UrlCreator` | `getReverseMapping(java.lang.String controller, java.lang.String action, java.lang.String namespace, java.lang.String pluginName, java.util.Map params)` @see UrlMappingsHolder#getReverseMapping(String, String, java.util.Map)
`UrlCreator` | `getReverseMappingNoDefault(java.lang.String controller, java.lang.String action, java.util.Map params)`
`UrlCreator` | `getReverseMappingNoDefault(java.lang.String controller, java.lang.String action, java.lang.String namespace, java.lang.String pluginName, java.lang.String httpMethod, java.util.Map params)`
`UrlCreator` | `getReverseMappingNoDefault(java.lang.String controller, java.lang.String action, java.lang.String namespace, java.lang.String pluginName, java.lang.String httpMethod, java.lang.String version, java.util.Map params)`
`UrlMapping[]` | `getUrlMappings()`
`void` | `initialize()`
`protected UrlMapping` | `lookupMapping(java.lang.String controller, java.lang.String action, java.lang.String namespace, java.lang.String pluginName, java.lang.String httpMethod, java.lang.String version, java.util.Map params)` Performs a match uses reverse mappings to looks up a mapping from the controller, action and params.
`UrlMappingInfo` | `match(java.lang.String uri)`
`UrlMappingInfo[]` | `matchAll(java.lang.String uri)`
`UrlMappingInfo[]` | `matchAll(java.lang.String uri, java.lang.String httpMethod)`
`UrlMappingInfo[]` | `matchAll(java.lang.String uri, java.lang.String httpMethod, java.lang.String version)`
`UrlMappingInfo[]` | `matchAll(java.lang.String uri, org.springframework.http.HttpMethod httpMethod)`
`UrlMappingInfo[]` | `matchAll(java.lang.String uri, org.springframework.http.HttpMethod httpMethod, java.lang.String version)`
`UrlMappingInfo` | `matchStatusCode(int responseCode)`
`UrlMappingInfo` | `matchStatusCode(int responseCode, java.lang.Throwable e)`
`void` | `setMaxWeightedCacheCapacity(int maxWeightedCacheCapacity)`
`void` | `setUrlCreatorMaxWeightedCacheCapacity(int urlCreatorMaxWeightedCacheCapacity)`
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Constructor Detail

### DefaultUrlMappingsHolder

    public DefaultUrlMappingsHolder(java.util.List mappings)

### DefaultUrlMappingsHolder

    public DefaultUrlMappingsHolder(java.util.List mappings, java.util.List excludePatterns)

### DefaultUrlMappingsHolder

    public DefaultUrlMappingsHolder(java.util.List mappings, java.util.List excludePatterns, boolean doNotCallInit)

Method Detail

### addMappings

    @java.lang.Overridepublic Collection addMappings(Closure mappings) {
    public java.util.Collection addMappings(groovy.lang.Closure mappings)

### allowedMethods

    @java.lang.Overridefor (UrlMappingInfo urlMappingInfo : urlMappingInfos) {
    public java.util.Set allowedMethods(java.lang.String uri)

### getExcludePatterns

    public java.util.List getExcludePatterns()

### getReverseMapping

    public UrlCreator getReverseMapping(java.lang.String controller, java.lang.String action, java.util.Map params)

### getReverseMapping

    @java.lang.Overridepublic UrlCreator getReverseMapping(String controller, String action, String pluginName, Map params) {
    public UrlCreator getReverseMapping(java.lang.String controller, java.lang.String action, java.lang.String pluginName, java.util.Map params)

### getReverseMapping

    @java.lang.Overridepublic UrlCreator getReverseMapping(String controller, String action, String namespace, String pluginName, String httpMethod, Map params) {
    public UrlCreator getReverseMapping(java.lang.String controller, java.lang.String action, java.lang.String namespace, java.lang.String pluginName, java.lang.String httpMethod, java.util.Map params)

### getReverseMapping

    @java.lang.Overridepublic UrlCreator getReverseMapping(String controller, String action, String namespace, String pluginName, String httpMethod, String version, Map params) {
    public UrlCreator getReverseMapping(java.lang.String controller, java.lang.String action, java.lang.String namespace, java.lang.String pluginName, java.lang.String httpMethod, java.lang.String version, java.util.Map params)

### getReverseMapping

    public UrlCreator getReverseMapping(java.lang.String controller, java.lang.String action, java.lang.String namespace, java.lang.String pluginName, java.util.Map params)

  See Also:
    UrlMappingsHolder.getReverseMapping

### getReverseMappingNoDefault

    public UrlCreator getReverseMappingNoDefault(java.lang.String controller, java.lang.String action, java.util.Map params)

### getReverseMappingNoDefault

    @java.lang.Override}
    public UrlCreator getReverseMappingNoDefault(java.lang.String controller, java.lang.String action, java.lang.String namespace, java.lang.String pluginName, java.lang.String httpMethod, java.util.Map params)

### getReverseMappingNoDefault

    @java.lang.Override
    public UrlCreator getReverseMappingNoDefault(java.lang.String controller, java.lang.String action, java.lang.String namespace, java.lang.String pluginName, java.lang.String httpMethod, java.lang.String version, java.util.Map params)

### getUrlMappings

    public UrlMapping[] getUrlMappings()

### initialize

    public void initialize()

### lookupMapping

    @java.lang.SuppressWarningsfinal String actionName = lookupKey.action;
    protected UrlMapping lookupMapping(java.lang.String controller, java.lang.String action, java.lang.String namespace, java.lang.String pluginName, java.lang.String httpMethod, java.lang.String version, java.util.Map params)

  Performs a match uses reverse mappings to looks up a mapping from the controller, action and params. This is refactored to use a list of mappings identified by only controller and action and then matches the mapping to select the mapping that best matches the params (most possible matches).
  Parameters:
    `controller` - The controller name
    `action` - The action name
    `httpMethod` - The HTTP method
    version
    `params` - The params
  Returns:
    A UrlMapping instance or null

### match

    public UrlMappingInfo match(java.lang.String uri)

### matchAll

    public UrlMappingInfo[] matchAll(java.lang.String uri)

### matchAll

    public UrlMappingInfo[] matchAll(java.lang.String uri, java.lang.String httpMethod)

### matchAll

    public UrlMappingInfo[] matchAll(java.lang.String uri, java.lang.String httpMethod, java.lang.String version)

### matchAll

    @java.lang.Override
    public UrlMappingInfo[] matchAll(java.lang.String uri, org.springframework.http.HttpMethod httpMethod)

### matchAll

    @java.lang.Overridepublic UrlMappingInfo matchStatusCode(int responseCode) {
    public UrlMappingInfo[] matchAll(java.lang.String uri, org.springframework.http.HttpMethod httpMethod, java.lang.String version)

### matchStatusCode

    public UrlMappingInfo matchStatusCode(int responseCode)

### matchStatusCode

    public UrlMappingInfo matchStatusCode(int responseCode, java.lang.Throwable e)

### setMaxWeightedCacheCapacity

    public void setMaxWeightedCacheCapacity(int maxWeightedCacheCapacity)

### setUrlCreatorMaxWeightedCacheCapacity

    public void setUrlCreatorMaxWeightedCacheCapacity(int urlCreatorMaxWeightedCacheCapacity)

### toString

    @java.lang.Overridepw.println("------------");
    public java.lang.String toString()

Groovy Documentation