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