001/*
002 * Copyright 2002-2017 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.web.servlet.tags;
018
019/**
020 * Bean used to pass name-value pair parameters from a {@link ParamTag} to a
021 * {@link ParamAware} tag.
022 *
023 * <p>Attributes are the raw values passed to the spring:param tag and have not
024 * been encoded or escaped.
025 *
026 * @author Scott Andrews
027 * @since 3.0
028 * @see ParamTag
029 */
030public class Param {
031
032        private String name;
033
034        private String value;
035
036
037        /**
038         * Set the raw name of the parameter.
039         */
040        public void setName(String name) {
041                this.name = name;
042        }
043
044        /**
045         * Return the raw parameter name.
046         */
047        public String getName() {
048                return this.name;
049        }
050
051        /**
052         * Set the raw value of the parameter.
053         */
054        public void setValue(String value) {
055                this.value = value;
056        }
057
058        /**
059         * Return the raw parameter value.
060         */
061        public String getValue() {
062                return this.value;
063        }
064
065
066        @Override
067        public String toString() {
068                return "JSP Tag Param: name '" + this.name + "', value '" + this.value + "'";
069        }
070
071}