2
* $Header: /home/cvs/jakarta-commons/validator/src/share/org/apache/commons/validator/Attic/Constant.java,v 1.10 2004/02/21 17:10:29 rleland Exp $
4
* $Date: 2004/02/21 17:10:29 $
6
* ====================================================================
7
* Copyright 2001-2004 The Apache Software Foundation
9
* Licensed under the Apache License, Version 2.0 (the "License");
10
* you may not use this file except in compliance with the License.
11
* You may obtain a copy of the License at
13
* http://www.apache.org/licenses/LICENSE-2.0
15
* Unless required by applicable law or agreed to in writing, software
16
* distributed under the License is distributed on an "AS IS" BASIS,
17
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
* See the License for the specific language governing permissions and
19
* limitations under the License.
23
package org.apache.commons.validator;
25
import java.io.Serializable;
29
* <p>A constant can be used to define a global or
30
* locale level constant that can be used to replace
31
* values in certain fields. The <code>Field</code>'s
32
* property field, the <code>Var</code>'s value field,
33
* the <code>Msg</code>'s key field, and the <code>Arg</code>'s
34
* key field can all contain constants reference for replacement.
36
* ex: <constant name="zip" value="^\d{5}$" /> mask="${zip}" </p>
38
* @deprecated This class is no longer needed.
40
public class Constant implements Serializable {
43
* The name of the constant.
45
private String name = null;
48
* The name of the constant.
50
private String value = null;
53
* Gets the name of the constant.
54
* @return the name o fthe constant.
56
public String getName() {
61
* Sets the name of the constant.
62
* @param name sets the name of the constant.
64
public void setName(String name) {
69
* Gets the value of the constant.
70
* @return the value of the constant.
72
public String getValue() {
77
* Sets the value of the constant.
78
* @param value the value of the constant.
80
public void setValue(String value) {
85
* Returns a string representation of the object.
86
* @return the string representation of the object.
88
public String toString() {
89
StringBuffer results = new StringBuffer();
91
results.append("Constant: name=");
93
results.append(" value=");
94
results.append(value);
97
return results.toString();
b'\\ No newline at end of file'