001: /*
002: * This class was automatically generated with
003: * <a href="http://www.castor.org">Castor 0.9.4.3</a>, using an XML
004: * Schema.
005: * $Id$
006: */
007:
008: package com.calipso.reportgenerator.reportdefinitions;
009:
010: //---------------------------------/
011: //- Imported classes and packages -/
012: //---------------------------------/
013:
014: import java.io.IOException;
015: import java.io.Reader;
016: import java.io.Serializable;
017: import java.io.Writer;
018: import java.util.Enumeration;
019: import java.util.Vector;
020: import org.exolab.castor.xml.MarshalException;
021: import org.exolab.castor.xml.Marshaller;
022: import org.exolab.castor.xml.Unmarshaller;
023: import org.exolab.castor.xml.ValidationException;
024: import org.xml.sax.ContentHandler;
025:
026: /**
027: * Class Localizations.
028: *
029: * @version $Revision$ $Date$
030: */
031: public class Localizations implements java.io.Serializable {
032:
033: //--------------------------/
034: //- Class/Member Variables -/
035: //--------------------------/
036:
037: /**
038: * Field _localizationList
039: */
040: private java.util.Vector _localizationList;
041:
042: //----------------/
043: //- Constructors -/
044: //----------------/
045:
046: public Localizations() {
047: super ();
048: _localizationList = new Vector();
049: } //-- com.calipso.reportgenerator.reportdefinitions.Localizations()
050:
051: //-----------/
052: //- Methods -/
053: //-----------/
054:
055: /**
056: * Method addLocalization
057: *
058: * @param vLocalization
059: */
060: public void addLocalization(
061: com.calipso.reportgenerator.reportdefinitions.Localization vLocalization)
062: throws java.lang.IndexOutOfBoundsException {
063: _localizationList.addElement(vLocalization);
064: } //-- void addLocalization(com.calipso.reportgenerator.reportdefinitions.Localization)
065:
066: /**
067: * Method addLocalization
068: *
069: * @param index
070: * @param vLocalization
071: */
072: public void addLocalization(
073: int index,
074: com.calipso.reportgenerator.reportdefinitions.Localization vLocalization)
075: throws java.lang.IndexOutOfBoundsException {
076: _localizationList.insertElementAt(vLocalization, index);
077: } //-- void addLocalization(int, com.calipso.reportgenerator.reportdefinitions.Localization)
078:
079: /**
080: * Method enumerateLocalization
081: */
082: public java.util.Enumeration enumerateLocalization() {
083: return _localizationList.elements();
084: } //-- java.util.Enumeration enumerateLocalization()
085:
086: /**
087: * Method getLocalization
088: *
089: * @param index
090: */
091: public com.calipso.reportgenerator.reportdefinitions.Localization getLocalization(
092: int index) throws java.lang.IndexOutOfBoundsException {
093: //-- check bounds for index
094: if ((index < 0) || (index > _localizationList.size())) {
095: throw new IndexOutOfBoundsException();
096: }
097:
098: return (com.calipso.reportgenerator.reportdefinitions.Localization) _localizationList
099: .elementAt(index);
100: } //-- com.calipso.reportgenerator.reportdefinitions.Localization getLocalization(int)
101:
102: /**
103: * Method getLocalization
104: */
105: public com.calipso.reportgenerator.reportdefinitions.Localization[] getLocalization() {
106: int size = _localizationList.size();
107: com.calipso.reportgenerator.reportdefinitions.Localization[] mArray = new com.calipso.reportgenerator.reportdefinitions.Localization[size];
108: for (int index = 0; index < size; index++) {
109: mArray[index] = (com.calipso.reportgenerator.reportdefinitions.Localization) _localizationList
110: .elementAt(index);
111: }
112: return mArray;
113: } //-- com.calipso.reportgenerator.reportdefinitions.Localization[] getLocalization()
114:
115: /**
116: * Method getLocalizationCount
117: */
118: public int getLocalizationCount() {
119: return _localizationList.size();
120: } //-- int getLocalizationCount()
121:
122: /**
123: * Method isValid
124: */
125: public boolean isValid() {
126: try {
127: validate();
128: } catch (org.exolab.castor.xml.ValidationException vex) {
129: return false;
130: }
131: return true;
132: } //-- boolean isValid()
133:
134: /**
135: * Method marshal
136: *
137: * @param out
138: */
139: public void marshal(java.io.Writer out)
140: throws org.exolab.castor.xml.MarshalException,
141: org.exolab.castor.xml.ValidationException {
142:
143: Marshaller.marshal(this , out);
144: } //-- void marshal(java.io.Writer)
145:
146: /**
147: * Method marshal
148: *
149: * @param handler
150: */
151: public void marshal(org.xml.sax.ContentHandler handler)
152: throws java.io.IOException,
153: org.exolab.castor.xml.MarshalException,
154: org.exolab.castor.xml.ValidationException {
155:
156: Marshaller.marshal(this , handler);
157: } //-- void marshal(org.xml.sax.ContentHandler)
158:
159: /**
160: * Method removeAllLocalization
161: */
162: public void removeAllLocalization() {
163: _localizationList.removeAllElements();
164: } //-- void removeAllLocalization()
165:
166: /**
167: * Method removeLocalization
168: *
169: * @param index
170: */
171: public com.calipso.reportgenerator.reportdefinitions.Localization removeLocalization(
172: int index) {
173: java.lang.Object obj = _localizationList.elementAt(index);
174: _localizationList.removeElementAt(index);
175: return (com.calipso.reportgenerator.reportdefinitions.Localization) obj;
176: } //-- com.calipso.reportgenerator.reportdefinitions.Localization removeLocalization(int)
177:
178: /**
179: * Method setLocalization
180: *
181: * @param index
182: * @param vLocalization
183: */
184: public void setLocalization(
185: int index,
186: com.calipso.reportgenerator.reportdefinitions.Localization vLocalization)
187: throws java.lang.IndexOutOfBoundsException {
188: //-- check bounds for index
189: if ((index < 0) || (index > _localizationList.size())) {
190: throw new IndexOutOfBoundsException();
191: }
192: _localizationList.setElementAt(vLocalization, index);
193: } //-- void setLocalization(int, com.calipso.reportgenerator.reportdefinitions.Localization)
194:
195: /**
196: * Method setLocalization
197: *
198: * @param localizationArray
199: */
200: public void setLocalization(
201: com.calipso.reportgenerator.reportdefinitions.Localization[] localizationArray) {
202: //-- copy array
203: _localizationList.removeAllElements();
204: for (int i = 0; i < localizationArray.length; i++) {
205: _localizationList.addElement(localizationArray[i]);
206: }
207: } //-- void setLocalization(com.calipso.reportgenerator.reportdefinitions.Localization)
208:
209: /**
210: * Method unmarshal
211: *
212: * @param reader
213: */
214: public static com.calipso.reportgenerator.reportdefinitions.Localizations unmarshal(
215: java.io.Reader reader)
216: throws org.exolab.castor.xml.MarshalException,
217: org.exolab.castor.xml.ValidationException {
218: return (com.calipso.reportgenerator.reportdefinitions.Localizations) Unmarshaller
219: .unmarshal(
220: com.calipso.reportgenerator.reportdefinitions.Localizations.class,
221: reader);
222: } //-- com.calipso.reportgenerator.reportdefinitions.Localizations unmarshal(java.io.Reader)
223:
224: /**
225: * Method validate
226: */
227: public void validate()
228: throws org.exolab.castor.xml.ValidationException {
229: org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
230: validator.validate(this );
231: } //-- void validate()
232:
233: }
|