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 ParameterValues.
028: *
029: * @version $Revision$ $Date$
030: */
031: public class ParameterValues implements java.io.Serializable {
032:
033: //--------------------------/
034: //- Class/Member Variables -/
035: //--------------------------/
036:
037: /**
038: * Field _parameterValueList
039: */
040: private java.util.Vector _parameterValueList;
041:
042: //----------------/
043: //- Constructors -/
044: //----------------/
045:
046: public ParameterValues() {
047: super ();
048: _parameterValueList = new Vector();
049: } //-- com.calipso.reportgenerator.reportdefinitions.ParameterValues()
050:
051: //-----------/
052: //- Methods -/
053: //-----------/
054:
055: /**
056: * Method addParameterValue
057: *
058: * @param vParameterValue
059: */
060: public void addParameterValue(
061: com.calipso.reportgenerator.reportdefinitions.ParameterValue vParameterValue)
062: throws java.lang.IndexOutOfBoundsException {
063: _parameterValueList.addElement(vParameterValue);
064: } //-- void addParameterValue(com.calipso.reportgenerator.reportdefinitions.ParameterValue)
065:
066: /**
067: * Method addParameterValue
068: *
069: * @param index
070: * @param vParameterValue
071: */
072: public void addParameterValue(
073: int index,
074: com.calipso.reportgenerator.reportdefinitions.ParameterValue vParameterValue)
075: throws java.lang.IndexOutOfBoundsException {
076: _parameterValueList.insertElementAt(vParameterValue, index);
077: } //-- void addParameterValue(int, com.calipso.reportgenerator.reportdefinitions.ParameterValue)
078:
079: /**
080: * Method enumerateParameterValue
081: */
082: public java.util.Enumeration enumerateParameterValue() {
083: return _parameterValueList.elements();
084: } //-- java.util.Enumeration enumerateParameterValue()
085:
086: /**
087: * Method getParameterValue
088: *
089: * @param index
090: */
091: public com.calipso.reportgenerator.reportdefinitions.ParameterValue getParameterValue(
092: int index) throws java.lang.IndexOutOfBoundsException {
093: //-- check bounds for index
094: if ((index < 0) || (index > _parameterValueList.size())) {
095: throw new IndexOutOfBoundsException();
096: }
097:
098: return (com.calipso.reportgenerator.reportdefinitions.ParameterValue) _parameterValueList
099: .elementAt(index);
100: } //-- com.calipso.reportgenerator.reportdefinitions.ParameterValue getParameterValue(int)
101:
102: /**
103: * Method getParameterValue
104: */
105: public com.calipso.reportgenerator.reportdefinitions.ParameterValue[] getParameterValue() {
106: int size = _parameterValueList.size();
107: com.calipso.reportgenerator.reportdefinitions.ParameterValue[] mArray = new com.calipso.reportgenerator.reportdefinitions.ParameterValue[size];
108: for (int index = 0; index < size; index++) {
109: mArray[index] = (com.calipso.reportgenerator.reportdefinitions.ParameterValue) _parameterValueList
110: .elementAt(index);
111: }
112: return mArray;
113: } //-- com.calipso.reportgenerator.reportdefinitions.ParameterValue[] getParameterValue()
114:
115: /**
116: * Method getParameterValueCount
117: */
118: public int getParameterValueCount() {
119: return _parameterValueList.size();
120: } //-- int getParameterValueCount()
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 removeAllParameterValue
161: */
162: public void removeAllParameterValue() {
163: _parameterValueList.removeAllElements();
164: } //-- void removeAllParameterValue()
165:
166: /**
167: * Method removeParameterValue
168: *
169: * @param index
170: */
171: public com.calipso.reportgenerator.reportdefinitions.ParameterValue removeParameterValue(
172: int index) {
173: java.lang.Object obj = _parameterValueList.elementAt(index);
174: _parameterValueList.removeElementAt(index);
175: return (com.calipso.reportgenerator.reportdefinitions.ParameterValue) obj;
176: } //-- com.calipso.reportgenerator.reportdefinitions.ParameterValue removeParameterValue(int)
177:
178: /**
179: * Method setParameterValue
180: *
181: * @param index
182: * @param vParameterValue
183: */
184: public void setParameterValue(
185: int index,
186: com.calipso.reportgenerator.reportdefinitions.ParameterValue vParameterValue)
187: throws java.lang.IndexOutOfBoundsException {
188: //-- check bounds for index
189: if ((index < 0) || (index > _parameterValueList.size())) {
190: throw new IndexOutOfBoundsException();
191: }
192: _parameterValueList.setElementAt(vParameterValue, index);
193: } //-- void setParameterValue(int, com.calipso.reportgenerator.reportdefinitions.ParameterValue)
194:
195: /**
196: * Method setParameterValue
197: *
198: * @param parameterValueArray
199: */
200: public void setParameterValue(
201: com.calipso.reportgenerator.reportdefinitions.ParameterValue[] parameterValueArray) {
202: //-- copy array
203: _parameterValueList.removeAllElements();
204: for (int i = 0; i < parameterValueArray.length; i++) {
205: _parameterValueList.addElement(parameterValueArray[i]);
206: }
207: } //-- void setParameterValue(com.calipso.reportgenerator.reportdefinitions.ParameterValue)
208:
209: /**
210: * Method unmarshal
211: *
212: * @param reader
213: */
214: public static com.calipso.reportgenerator.reportdefinitions.ParameterValues 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.ParameterValues) Unmarshaller
219: .unmarshal(
220: com.calipso.reportgenerator.reportdefinitions.ParameterValues.class,
221: reader);
222: } //-- com.calipso.reportgenerator.reportdefinitions.ParameterValues 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: }
|