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 019import org.springframework.lang.Nullable; 020 021/** 022 * Bean used to pass name-value pair parameters from a {@link ParamTag} to a 023 * {@link ParamAware} tag. 024 * 025 * <p>Attributes are the raw values passed to the spring:param tag and have not 026 * been encoded or escaped. 027 * 028 * @author Scott Andrews 029 * @since 3.0 030 * @see ParamTag 031 */ 032public class Param { 033 034 @Nullable 035 private String name; 036 037 @Nullable 038 private String value; 039 040 041 /** 042 * Set the raw name of the parameter. 043 */ 044 public void setName(@Nullable String name) { 045 this.name = name; 046 } 047 048 /** 049 * Return the raw parameter name. 050 */ 051 @Nullable 052 public String getName() { 053 return this.name; 054 } 055 056 /** 057 * Set the raw value of the parameter. 058 */ 059 public void setValue(@Nullable String value) { 060 this.value = value; 061 } 062 063 /** 064 * Return the raw parameter value. 065 */ 066 @Nullable 067 public String getValue() { 068 return this.value; 069 } 070 071 072 @Override 073 public String toString() { 074 return "JSP Tag Param: name '" + this.name + "', value '" + this.value + "'"; 075 } 076 077}