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 LightBoxer.
028: *
029: * @version $Revision$ $Date$
030: */
031: public class LightBoxer implements java.io.Serializable {
032:
033: //--------------------------/
034: //- Class/Member Variables -/
035: //--------------------------/
036:
037: /**
038: * Field _lightBoxDefinitionList
039: */
040: private java.util.Vector _lightBoxDefinitionList;
041:
042: //----------------/
043: //- Constructors -/
044: //----------------/
045:
046: public LightBoxer() {
047: super ();
048: _lightBoxDefinitionList = new Vector();
049: } //-- com.calipso.reportgenerator.reportdefinitions.LightBoxer()
050:
051: //-----------/
052: //- Methods -/
053: //-----------/
054:
055: /**
056: * Method addLightBoxDefinition
057: *
058: * @param vLightBoxDefinition
059: */
060: public void addLightBoxDefinition(
061: com.calipso.reportgenerator.reportdefinitions.LightBoxDefinition vLightBoxDefinition)
062: throws java.lang.IndexOutOfBoundsException {
063: _lightBoxDefinitionList.addElement(vLightBoxDefinition);
064: } //-- void addLightBoxDefinition(com.calipso.reportgenerator.reportdefinitions.LightBoxDefinition)
065:
066: /**
067: * Method addLightBoxDefinition
068: *
069: * @param index
070: * @param vLightBoxDefinition
071: */
072: public void addLightBoxDefinition(
073: int index,
074: com.calipso.reportgenerator.reportdefinitions.LightBoxDefinition vLightBoxDefinition)
075: throws java.lang.IndexOutOfBoundsException {
076: _lightBoxDefinitionList.insertElementAt(vLightBoxDefinition,
077: index);
078: } //-- void addLightBoxDefinition(int, com.calipso.reportgenerator.reportdefinitions.LightBoxDefinition)
079:
080: /**
081: * Method enumerateLightBoxDefinition
082: */
083: public java.util.Enumeration enumerateLightBoxDefinition() {
084: return _lightBoxDefinitionList.elements();
085: } //-- java.util.Enumeration enumerateLightBoxDefinition()
086:
087: /**
088: * Method getLightBoxDefinition
089: *
090: * @param index
091: */
092: public com.calipso.reportgenerator.reportdefinitions.LightBoxDefinition getLightBoxDefinition(
093: int index) throws java.lang.IndexOutOfBoundsException {
094: //-- check bounds for index
095: if ((index < 0) || (index > _lightBoxDefinitionList.size())) {
096: throw new IndexOutOfBoundsException();
097: }
098:
099: return (com.calipso.reportgenerator.reportdefinitions.LightBoxDefinition) _lightBoxDefinitionList
100: .elementAt(index);
101: } //-- com.calipso.reportgenerator.reportdefinitions.LightBoxDefinition getLightBoxDefinition(int)
102:
103: /**
104: * Method getLightBoxDefinition
105: */
106: public com.calipso.reportgenerator.reportdefinitions.LightBoxDefinition[] getLightBoxDefinition() {
107: int size = _lightBoxDefinitionList.size();
108: com.calipso.reportgenerator.reportdefinitions.LightBoxDefinition[] mArray = new com.calipso.reportgenerator.reportdefinitions.LightBoxDefinition[size];
109: for (int index = 0; index < size; index++) {
110: mArray[index] = (com.calipso.reportgenerator.reportdefinitions.LightBoxDefinition) _lightBoxDefinitionList
111: .elementAt(index);
112: }
113: return mArray;
114: } //-- com.calipso.reportgenerator.reportdefinitions.LightBoxDefinition[] getLightBoxDefinition()
115:
116: /**
117: * Method getLightBoxDefinitionCount
118: */
119: public int getLightBoxDefinitionCount() {
120: return _lightBoxDefinitionList.size();
121: } //-- int getLightBoxDefinitionCount()
122:
123: /**
124: * Method isValid
125: */
126: public boolean isValid() {
127: try {
128: validate();
129: } catch (org.exolab.castor.xml.ValidationException vex) {
130: return false;
131: }
132: return true;
133: } //-- boolean isValid()
134:
135: /**
136: * Method marshal
137: *
138: * @param out
139: */
140: public void marshal(java.io.Writer out)
141: throws org.exolab.castor.xml.MarshalException,
142: org.exolab.castor.xml.ValidationException {
143:
144: Marshaller.marshal(this , out);
145: } //-- void marshal(java.io.Writer)
146:
147: /**
148: * Method marshal
149: *
150: * @param handler
151: */
152: public void marshal(org.xml.sax.ContentHandler handler)
153: throws java.io.IOException,
154: org.exolab.castor.xml.MarshalException,
155: org.exolab.castor.xml.ValidationException {
156:
157: Marshaller.marshal(this , handler);
158: } //-- void marshal(org.xml.sax.ContentHandler)
159:
160: /**
161: * Method removeAllLightBoxDefinition
162: */
163: public void removeAllLightBoxDefinition() {
164: _lightBoxDefinitionList.removeAllElements();
165: } //-- void removeAllLightBoxDefinition()
166:
167: /**
168: * Method removeLightBoxDefinition
169: *
170: * @param index
171: */
172: public com.calipso.reportgenerator.reportdefinitions.LightBoxDefinition removeLightBoxDefinition(
173: int index) {
174: java.lang.Object obj = _lightBoxDefinitionList.elementAt(index);
175: _lightBoxDefinitionList.removeElementAt(index);
176: return (com.calipso.reportgenerator.reportdefinitions.LightBoxDefinition) obj;
177: } //-- com.calipso.reportgenerator.reportdefinitions.LightBoxDefinition removeLightBoxDefinition(int)
178:
179: /**
180: * Method setLightBoxDefinition
181: *
182: * @param index
183: * @param vLightBoxDefinition
184: */
185: public void setLightBoxDefinition(
186: int index,
187: com.calipso.reportgenerator.reportdefinitions.LightBoxDefinition vLightBoxDefinition)
188: throws java.lang.IndexOutOfBoundsException {
189: //-- check bounds for index
190: if ((index < 0) || (index > _lightBoxDefinitionList.size())) {
191: throw new IndexOutOfBoundsException();
192: }
193: _lightBoxDefinitionList
194: .setElementAt(vLightBoxDefinition, index);
195: } //-- void setLightBoxDefinition(int, com.calipso.reportgenerator.reportdefinitions.LightBoxDefinition)
196:
197: /**
198: * Method setLightBoxDefinition
199: *
200: * @param lightBoxDefinitionArray
201: */
202: public void setLightBoxDefinition(
203: com.calipso.reportgenerator.reportdefinitions.LightBoxDefinition[] lightBoxDefinitionArray) {
204: //-- copy array
205: _lightBoxDefinitionList.removeAllElements();
206: for (int i = 0; i < lightBoxDefinitionArray.length; i++) {
207: _lightBoxDefinitionList
208: .addElement(lightBoxDefinitionArray[i]);
209: }
210: } //-- void setLightBoxDefinition(com.calipso.reportgenerator.reportdefinitions.LightBoxDefinition)
211:
212: /**
213: * Method unmarshal
214: *
215: * @param reader
216: */
217: public static com.calipso.reportgenerator.reportdefinitions.LightBoxer unmarshal(
218: java.io.Reader reader)
219: throws org.exolab.castor.xml.MarshalException,
220: org.exolab.castor.xml.ValidationException {
221: return (com.calipso.reportgenerator.reportdefinitions.LightBoxer) Unmarshaller
222: .unmarshal(
223: com.calipso.reportgenerator.reportdefinitions.LightBoxer.class,
224: reader);
225: } //-- com.calipso.reportgenerator.reportdefinitions.LightBoxer unmarshal(java.io.Reader)
226:
227: /**
228: * Method validate
229: */
230: public void validate()
231: throws org.exolab.castor.xml.ValidationException {
232: org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
233: validator.validate(this );
234: } //-- void validate()
235:
236: }
|