KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > tigris > scarab > util > build > l10nchecker > L10nMessage


1 package org.tigris.scarab.util.build.l10nchecker;
2
3
4 /* ================================================================
5  * Copyright (c) 2005 CollabNet. All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are
9  * met:
10  *
11  * 1. Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the distribution.
17  *
18  * 3. The end-user documentation included with the redistribution, if
19  * any, must include the following acknowlegement: "This product includes
20  * software developed by Collab.Net <http://www.Collab.Net/>."
21  * Alternately, this acknowlegement may appear in the software itself, if
22  * and wherever such third-party acknowlegements normally appear.
23  *
24  * 4. The hosted project names must not be used to endorse or promote
25  * products derived from this software without prior written
26  * permission. For written permission, please contact info@collab.net.
27  *
28  * 5. Products derived from this software may not use the "Tigris" or
29  * "Scarab" names nor may "Tigris" or "Scarab" appear in their names without
30  * prior written permission of Collab.Net.
31  *
32  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
33  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
34  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
35  * IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
36  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
38  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
39  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
40  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
41  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
42  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43  *
44  * ====================================================================
45  *
46  * This software consists of voluntary contributions made by many
47  * individuals on behalf of Collab.Net.
48  */

49
50 /**
51  * Interface that contains a message (information, warning, error) that can be
52  * created during initialisation
53
54  * @author sreindl
55  */

56 public class L10nMessage
57 {
58     /* line number */
59     private int lineNumber;
60
61     /* message text */
62     private String JavaDoc messageText;
63
64     /* corresponding L10nObject */
65     private L10nKey l10nObject;
66     
67     /* The corresponding issue */
68     private L10nIssue issue;
69
70     /**
71      * INTERNAL-should not have been called
72      */

73     private L10nMessage()
74     {
75         throw new RuntimeException JavaDoc("This should not have been called");
76     }
77
78     /**
79      * Create a message of type INFORMATION at line #lineNo with message
80      * #issue.
81      *
82      * @param lineNo The line where the message appeared
83      * @param issue The issue to be created.
84      */

85     public L10nMessage(int lineNo, L10nIssue issue)
86     {
87         lineNumber = lineNo;
88         this.issue = issue;
89         this.messageText = issue.formatMessage();
90     }
91
92     /* getter setter methods */
93     /**
94      * Return the line number.
95      *
96      * @return Returns the lineNumber.
97      */

98     public int getLineNumber()
99     {
100         return lineNumber;
101     }
102
103     /**
104      * Set the line number
105      *
106      * @param lineNumber The lineNumber to set.
107      */

108     public void setLineNumber(int lineNumber)
109     {
110         this.lineNumber = lineNumber;
111     }
112
113     /**
114      * Return the message text.
115      *
116      * @return Returns the messageText.
117      */

118     public String JavaDoc getMessageText()
119     {
120         return messageText;
121     }
122
123     /**
124      * Set the message text.
125      *
126      * @return Returns the l10nObject.
127      */

128     public L10nKey getL10nObject()
129     {
130         return l10nObject;
131     }
132
133     /**
134      * Return the corresponding L10nKey.
135      *
136      * @param object The l10nKey to set.
137      */

138     public void setL10nObject(L10nKey object)
139     {
140         l10nObject = object;
141     }
142     
143     /**
144      * Return the issue assiciated to this message.
145      *
146      * @return Returns the issue.
147      */

148     public L10nIssue getIssue()
149     {
150         return issue;
151     }
152 }
153
Popular Tags