GRAILS-1019: Allowing expressions to be used with the 'disabled' attribute for g...
[grails.git] / src / web / org / codehaus / groovy / grails / web / mapping / AbstractUrlMapping.java
blob8f9b1f23e4a7bc5e17feec96902f5b20f494d02e
1 /* Copyright 2004-2005 Graeme Rocher
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
15 package org.codehaus.groovy.grails.web.mapping;
17 import org.codehaus.groovy.grails.validation.ConstrainedProperty;
19 import java.util.Collections;
20 import java.util.Map;
22 /**
23 * Abstract UrlMapping implementation that provides common basic functionality
25 * @author Graeme Rocher
26 * @since 0.5.5
27 * <p/>
28 * Created: May 30, 2007
29 * Time: 8:25:36 AM
31 public abstract class AbstractUrlMapping implements UrlMapping {
33 protected final ConstrainedProperty[] constraints;
34 protected Object controllerName;
35 protected Object actionName;
36 protected Object viewName;
37 protected Map parameterValues = Collections.EMPTY_MAP;
39 /**
40 * Base constructor required to construct a UrlMapping instance
42 * @param controllerName The name of the controller
43 * @param actionName The name of the action
44 * @param constraints Any constraints that apply to the mapping
46 public AbstractUrlMapping(Object controllerName, Object actionName, Object viewName,ConstrainedProperty[] constraints) {
47 this.controllerName = controllerName;
48 this.actionName = actionName;
49 this.constraints = constraints;
50 this.viewName = viewName;
54 protected AbstractUrlMapping(Object viewName, ConstrainedProperty[] constraints) {
55 this.viewName = viewName;
56 this.constraints = constraints;
59 /**
60 * @see UrlMapping#getConstraints()
63 public ConstrainedProperty[] getConstraints() {
64 return constraints;
67 /**
68 * @see UrlMapping#getControllerName()
70 public Object getControllerName() {
71 return controllerName;
73 /**
74 * @see org.codehaus.groovy.grails.web.mapping.UrlMapping#getActionName()
76 public Object getActionName() {
77 return actionName;
80 /**
81 * @see org.codehaus.groovy.grails.web.mapping.UrlMapping#getViewName()
84 public Object getViewName() {
85 return viewName;
88 public void setParameterValues(Map parameterValues) {
89 this.parameterValues = Collections.unmodifiableMap(parameterValues);