KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > tigris > scarab > util > build > l10nchecker > issues > DifferentAttributeCountIssue


1 package org.tigris.scarab.util.build.l10nchecker.issues;
2
3 import org.tigris.scarab.util.build.l10nchecker.L10nIssue;
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  * This error is produced in case the number of arguments is different in the
52  * reference and the localisation.
53  *
54  *<p>Example:
55  *
56  *<ul><li>Reference:
57  *<pre>
58  * a={0} should be {1}
59  *</pre>
60  *<li>Localisation:
61  *<pre>
62  * a={0} sollte {1} sein, Standart ist {2}
63  *</pre>
64  *</ul>
65  */

66 public class DifferentAttributeCountIssue extends L10nIssue
67 {
68     
69     private String JavaDoc key;
70     
71     private Integer JavaDoc attrCount;
72     private Integer JavaDoc origAttrCount;
73
74     /**
75      * Construct this issue
76      */

77     public DifferentAttributeCountIssue(String JavaDoc key, int attrCount, int origAttrCount)
78     {
79         this.key = key;
80         this.attrCount = new Integer JavaDoc (attrCount);
81         this.origAttrCount = new Integer JavaDoc (origAttrCount);
82     }
83
84     /* (non-Javadoc)
85      * @see org.tigris.scarab.util.build.l10nchecker.L10nIssue#getMessageTemplate()
86      */

87     public String JavaDoc getMessageTemplate()
88     {
89         return "Key {0} contains different number of attributes ({1}) than reference ({2})";
90     }
91
92     /* (non-Javadoc)
93      * @see org.tigris.scarab.util.build.l10nchecker.L10nIssue#getParameters()
94      */

95     public Object JavaDoc[] getParameters()
96     {
97         return new Object JavaDoc[] { key, attrCount, origAttrCount };
98     }
99 }
100
Popular Tags