KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > util > explorer > swing > gui > lib > DefaultValidateReport


1 /*====================================================================
2
3 Objectweb Explorer Framework
4 Copyright (C) 2000-2004 INRIA - USTL - LIFL - GOAL
5 Contact: openccm@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Jerome Moroy, Philippe Merle.
23 Contributor(s): ______________________________________.
24
25 ====================================================================*/

26
27 package org.objectweb.util.explorer.swing.gui.lib;
28
29 import org.objectweb.util.explorer.swing.gui.api.ValidateReport;
30
31
32 /**
33  * Basic implementation of a ValidateReport.
34  *
35  * @author <a HREF="mailto:Jerome.Moroy@lifl.fr">Jerome Moroy</a>
36  *
37  * @version 0.1
38  */

39 public class DefaultValidateReport
40   implements ValidateReport
41 {
42
43     //==================================================================
44
//
45
// Internal state.
46
//
47
//==================================================================
48

49     /** The result of the validate method invocation */
50     protected boolean result_;
51     
52     /** The message which explains the result */
53     protected String JavaDoc message_;
54
55     //==================================================================
56
//
57
// Constructors.
58
//
59
//==================================================================
60

61     /**
62      * Empty constructor
63      * Default values are :
64      * <ul>
65      * <li>result : true</li>
66      * <li>message : ""</li>
67      * </ul>
68      */

69     public DefaultValidateReport(){
70         result_ = true;
71         message_ = "";
72     }
73     
74     /**
75      * Constructor with params
76      * @param result The result of the validate method invocation
77      * @param message The message which explains the result
78      */

79     public DefaultValidateReport(boolean result, String JavaDoc message){
80         result_ = result;
81         message_ = message;
82     }
83
84     //==================================================================
85
//
86
// Internal methods.
87
//
88
//==================================================================
89

90     //==================================================================
91
//
92
// Public methods for ValidateReport
93
//
94
//==================================================================
95

96     /**
97      * Fixes the result value.
98      * <ul>
99      * <li>TRUE if the result is OK</li>
100      * <li>FALSE if the result is not OK</li>
101      * </ul>
102      * @param result
103      */

104     public void setResult(boolean result){
105         result_ = result;
106     }
107     
108     /**
109      * Gets the result value.
110      * @return The result value
111      */

112     public boolean getResult(){
113         return result_;
114     }
115     
116     /**
117      * Fixes the message to explain why the result is not OK.
118      * @param message An explanation message
119      */

120     public void setMessage(String JavaDoc message){
121         message_ = message;
122     }
123     
124     /**
125      * Gets the explanation message
126      * @return The explanation message
127      */

128     public String JavaDoc getMessage(){
129         return message_;
130     }
131
132 }
Popular Tags