KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > struts > action > ActionErrors


1 /*
2  * $Id: ActionErrors.java 54929 2004-10-16 16:38:42Z germuska $
3  *
4  * Copyright 2000-2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 package org.apache.struts.action;
20
21 import java.io.Serializable JavaDoc;
22
23 /**
24  * <p>A class that encapsulates the error messages being reported by
25  * the <code>validate()</code> method of an <code>ActionForm</code>.
26  * Validation errors are either global to the entire <code>ActionForm</code>
27  * bean they are associated with, or they are specific to a particular
28  * bean property (and, therefore, a particular input field on the corresponding
29  * form).</p>
30  *
31  * <p>Each individual error is described by an <code>ActionMessage</code>
32  * object, which contains a message key (to be looked up in an appropriate
33  * message resources database), and up to four placeholder arguments used for
34  * parametric substitution in the resulting message.</p>
35  *
36  * <p><strong>IMPLEMENTATION NOTE</strong> - It is assumed that these objects
37  * are created and manipulated only within the context of a single thread.
38  * Therefore, no synchronization is required for access to internal
39  * collections.</p>
40  *
41  * @version $Rev: 54929 $ $Date: 2004-10-16 17:38:42 +0100 (Sat, 16 Oct 2004) $
42  */

43 public class ActionErrors extends ActionMessages implements Serializable JavaDoc {
44
45     // ----------------------------------------------------- Manifest Constants
46

47     /**
48      * The "property name" marker to use for global errors, as opposed to
49      * those related to a specific property.
50      * @deprecated Use ActionMessages.GLOBAL_MESSAGE instead. This will be
51      * removed after Struts 1.2.
52      */

53     public static final String JavaDoc GLOBAL_ERROR = "org.apache.struts.action.GLOBAL_ERROR";
54
55     // --------------------------------------------------------- Public Methods
56

57     /**
58      * Create an empty <code>ActionErrors</code> object.
59      */

60     public ActionErrors() {
61         super();
62     }
63
64     /**
65      * Create an <code>ActionErrors</code> object initialized with the given
66      * messages.
67      *
68      * @param messages The messages to be initially added to this object.
69      * This parameter can be <code>null</code>.
70      * @since Struts 1.1
71      */

72     public ActionErrors(ActionErrors messages) {
73         super(messages);
74     }
75
76     /**
77      * Add an error message to the set of errors for the specified property.
78      *
79      * @param property Property name (or ActionErrors.GLOBAL_ERROR)
80      * @param error The error message to be added
81      * @deprecated Use add(String, ActionMessage) instead. This will be
82      * removed after Struts 1.2.
83      */

84     public void add(String JavaDoc property, ActionError error) {
85
86         super.add(property, error);
87
88     }
89
90 }
91
Popular Tags