KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > util > browser > gui > lib > DefaultValidateReport


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2003 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.
23 Contributor(s): ______________________________________.
24
25 ====================================================================*/

26
27 package org.objectweb.util.browser.gui.lib;
28
29 /** The Browser API's imports */
30 import org.objectweb.util.browser.gui.api.ValidateReport;
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
// Internal state.
45
//
46
//==================================================================
47

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

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

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

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

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

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

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

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

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

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