KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > calipso > reportgenerator > reportdefinitions > Localization


1 /*
2  * This class was automatically generated with
3  * <a HREF="http://www.castor.org">Castor 0.9.4.3</a>, using an XML
4  * Schema.
5  * $Id$
6  */

7
8 package com.calipso.reportgenerator.reportdefinitions;
9
10   //---------------------------------/
11
//- Imported classes and packages -/
12
//---------------------------------/
13

14 import java.io.IOException JavaDoc;
15 import java.io.Reader JavaDoc;
16 import java.io.Serializable JavaDoc;
17 import java.io.Writer JavaDoc;
18 import java.util.Enumeration JavaDoc;
19 import java.util.Vector JavaDoc;
20 import org.exolab.castor.xml.MarshalException;
21 import org.exolab.castor.xml.Marshaller;
22 import org.exolab.castor.xml.Unmarshaller;
23 import org.exolab.castor.xml.ValidationException;
24 import org.xml.sax.ContentHandler JavaDoc;
25
26 /**
27  * Class Localization.
28  *
29  * @version $Revision$ $Date$
30  */

31 public class Localization implements java.io.Serializable JavaDoc {
32
33
34       //--------------------------/
35
//- Class/Member Variables -/
36
//--------------------------/
37

38     /**
39      * Field _locale
40      */

41     private java.lang.String JavaDoc _locale;
42
43     /**
44      * Field _literalsList
45      */

46     private java.util.Vector JavaDoc _literalsList;
47
48
49       //----------------/
50
//- Constructors -/
51
//----------------/
52

53     public Localization() {
54         super();
55         _literalsList = new Vector JavaDoc();
56     } //-- com.calipso.reportgenerator.reportdefinitions.Localization()
57

58
59       //-----------/
60
//- Methods -/
61
//-----------/
62

63     /**
64      * Method addLiterals
65      *
66      * @param vLiterals
67      */

68     public void addLiterals(com.calipso.reportgenerator.reportdefinitions.Literals vLiterals)
69         throws java.lang.IndexOutOfBoundsException JavaDoc
70     {
71         _literalsList.addElement(vLiterals);
72     } //-- void addLiterals(com.calipso.reportgenerator.reportdefinitions.Literals)
73

74     /**
75      * Method addLiterals
76      *
77      * @param index
78      * @param vLiterals
79      */

80     public void addLiterals(int index, com.calipso.reportgenerator.reportdefinitions.Literals vLiterals)
81         throws java.lang.IndexOutOfBoundsException JavaDoc
82     {
83         _literalsList.insertElementAt(vLiterals, index);
84     } //-- void addLiterals(int, com.calipso.reportgenerator.reportdefinitions.Literals)
85

86     /**
87      * Method enumerateLiterals
88      */

89     public java.util.Enumeration JavaDoc enumerateLiterals()
90     {
91         return _literalsList.elements();
92     } //-- java.util.Enumeration enumerateLiterals()
93

94     /**
95      * Method getLiterals
96      *
97      * @param index
98      */

99     public com.calipso.reportgenerator.reportdefinitions.Literals getLiterals(int index)
100         throws java.lang.IndexOutOfBoundsException JavaDoc
101     {
102         //-- check bounds for index
103
if ((index < 0) || (index > _literalsList.size())) {
104             throw new IndexOutOfBoundsException JavaDoc();
105         }
106         
107         return (com.calipso.reportgenerator.reportdefinitions.Literals) _literalsList.elementAt(index);
108     } //-- com.calipso.reportgenerator.reportdefinitions.Literals getLiterals(int)
109

110     /**
111      * Method getLiterals
112      */

113     public com.calipso.reportgenerator.reportdefinitions.Literals[] getLiterals()
114     {
115         int size = _literalsList.size();
116         com.calipso.reportgenerator.reportdefinitions.Literals[] mArray = new com.calipso.reportgenerator.reportdefinitions.Literals[size];
117         for (int index = 0; index < size; index++) {
118             mArray[index] = (com.calipso.reportgenerator.reportdefinitions.Literals) _literalsList.elementAt(index);
119         }
120         return mArray;
121     } //-- com.calipso.reportgenerator.reportdefinitions.Literals[] getLiterals()
122

123     /**
124      * Method getLiteralsCount
125      */

126     public int getLiteralsCount()
127     {
128         return _literalsList.size();
129     } //-- int getLiteralsCount()
130

131     /**
132      * Method getLocaleReturns the value of field 'locale'.
133      *
134      * @return the value of field 'locale'.
135      */

136     public java.lang.String JavaDoc getLocale()
137     {
138         return this._locale;
139     } //-- java.lang.String getLocale()
140

141     /**
142      * Method isValid
143      */

144     public boolean isValid()
145     {
146         try {
147             validate();
148         }
149         catch (org.exolab.castor.xml.ValidationException vex) {
150             return false;
151         }
152         return true;
153     } //-- boolean isValid()
154

155     /**
156      * Method marshal
157      *
158      * @param out
159      */

160     public void marshal(java.io.Writer JavaDoc out)
161         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
162     {
163         
164         Marshaller.marshal(this, out);
165     } //-- void marshal(java.io.Writer)
166

167     /**
168      * Method marshal
169      *
170      * @param handler
171      */

172     public void marshal(org.xml.sax.ContentHandler JavaDoc handler)
173         throws java.io.IOException JavaDoc, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
174     {
175         
176         Marshaller.marshal(this, handler);
177     } //-- void marshal(org.xml.sax.ContentHandler)
178

179     /**
180      * Method removeAllLiterals
181      */

182     public void removeAllLiterals()
183     {
184         _literalsList.removeAllElements();
185     } //-- void removeAllLiterals()
186

187     /**
188      * Method removeLiterals
189      *
190      * @param index
191      */

192     public com.calipso.reportgenerator.reportdefinitions.Literals removeLiterals(int index)
193     {
194         java.lang.Object JavaDoc obj = _literalsList.elementAt(index);
195         _literalsList.removeElementAt(index);
196         return (com.calipso.reportgenerator.reportdefinitions.Literals) obj;
197     } //-- com.calipso.reportgenerator.reportdefinitions.Literals removeLiterals(int)
198

199     /**
200      * Method setLiterals
201      *
202      * @param index
203      * @param vLiterals
204      */

205     public void setLiterals(int index, com.calipso.reportgenerator.reportdefinitions.Literals vLiterals)
206         throws java.lang.IndexOutOfBoundsException JavaDoc
207     {
208         //-- check bounds for index
209
if ((index < 0) || (index > _literalsList.size())) {
210             throw new IndexOutOfBoundsException JavaDoc();
211         }
212         _literalsList.setElementAt(vLiterals, index);
213     } //-- void setLiterals(int, com.calipso.reportgenerator.reportdefinitions.Literals)
214

215     /**
216      * Method setLiterals
217      *
218      * @param literalsArray
219      */

220     public void setLiterals(com.calipso.reportgenerator.reportdefinitions.Literals[] literalsArray)
221     {
222         //-- copy array
223
_literalsList.removeAllElements();
224         for (int i = 0; i < literalsArray.length; i++) {
225             _literalsList.addElement(literalsArray[i]);
226         }
227     } //-- void setLiterals(com.calipso.reportgenerator.reportdefinitions.Literals)
228

229     /**
230      * Method setLocaleSets the value of field 'locale'.
231      *
232      * @param locale the value of field 'locale'.
233      */

234     public void setLocale(java.lang.String JavaDoc locale)
235     {
236         this._locale = locale;
237     } //-- void setLocale(java.lang.String)
238

239     /**
240      * Method unmarshal
241      *
242      * @param reader
243      */

244     public static com.calipso.reportgenerator.reportdefinitions.Localization unmarshal(java.io.Reader JavaDoc reader)
245         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
246     {
247         return (com.calipso.reportgenerator.reportdefinitions.Localization) Unmarshaller.unmarshal(com.calipso.reportgenerator.reportdefinitions.Localization.class, reader);
248     } //-- com.calipso.reportgenerator.reportdefinitions.Localization unmarshal(java.io.Reader)
249

250     /**
251      * Method validate
252      */

253     public void validate()
254         throws org.exolab.castor.xml.ValidationException
255     {
256         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
257         validator.validate(this);
258     } //-- void validate()
259

260 }
261
Popular Tags