1 /* 2 * Copyright 2004-2009 the original author or authors. 3 * 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 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 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. 15 */ 16 17 package org.springmodules.validation.bean.context.web; 18 19 /** 20 * Represents a mapping between a url pattern to a list of validation context tokens. 21 * 22 * @author Uri Boness 23 */ 24 public class ValidationContextUrlMapping { 25 26 private String urlPattern; 27 28 private String[] contextTokens; 29 30 /** 31 * Default contructor. 32 */ 33 public ValidationContextUrlMapping() { 34 this(null, null); 35 } 36 37 /** 38 * Constructs a new mapping for the given url pattern to the given validation context tokens. 39 * 40 * @param urlPattern The given url pattern. 41 * @param contextTokens The mapped validation context tokens. 42 */ 43 public ValidationContextUrlMapping(String urlPattern, String[] contextTokens) { 44 this.urlPattern = urlPattern; 45 this.contextTokens = contextTokens; 46 } 47 48 49 //============================================== Setter/Getter ===================================================== 50 51 /** 52 * Returns the url pattern. 53 * 54 * @return The url pattern. 55 */ 56 public String getUrlPattern() { 57 return urlPattern; 58 } 59 60 /** 61 * Sets the url pattern for this mapping. 62 * 63 * @param urlPattern The url pattern for this mapping. 64 */ 65 public void setUrlPattern(String urlPattern) { 66 this.urlPattern = urlPattern; 67 } 68 69 /** 70 * Returns the validation context tokens of this mapping. 71 * 72 * @return The validation context tokens of this mapping. 73 */ 74 public String[] getContextTokens() { 75 return contextTokens; 76 } 77 78 /** 79 * Sets the validation context tokens for this mapping. 80 * 81 * @param contextTokens The validation context tokens for this mapping. 82 */ 83 public void setContextTokens(String[] contextTokens) { 84 this.contextTokens = contextTokens; 85 } 86 87 }