1 7 8 package org.openejb.alt.config.ejb11; 9 10 14 import java.io.IOException ; 15 import java.io.Reader ; 16 import java.io.Serializable ; 17 import java.io.Writer ; 18 import java.util.Enumeration ; 19 import java.util.Vector ; 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 ; 25 26 31 public class MethodParams implements java.io.Serializable { 32 33 34 38 41 private java.lang.String _id; 42 43 46 private java.util.Vector _methodParamList; 47 48 49 53 public MethodParams() { 54 super(); 55 _methodParamList = new Vector (); 56 } 58 59 63 68 public void addMethodParam(java.lang.String vMethodParam) 69 throws java.lang.IndexOutOfBoundsException 70 { 71 _methodParamList.addElement(vMethodParam); 72 } 74 80 public void addMethodParam(int index, java.lang.String vMethodParam) 81 throws java.lang.IndexOutOfBoundsException 82 { 83 _methodParamList.insertElementAt(vMethodParam, index); 84 } 86 89 public java.util.Enumeration enumerateMethodParam() 90 { 91 return _methodParamList.elements(); 92 } 94 99 public java.lang.String getId() 100 { 101 return this._id; 102 } 104 109 public java.lang.String getMethodParam(int index) 110 throws java.lang.IndexOutOfBoundsException 111 { 112 if ((index < 0) || (index > _methodParamList.size())) { 114 throw new IndexOutOfBoundsException (); 115 } 116 117 return (String )_methodParamList.elementAt(index); 118 } 120 123 public java.lang.String [] getMethodParam() 124 { 125 int size = _methodParamList.size(); 126 java.lang.String [] mArray = new java.lang.String [size]; 127 for (int index = 0; index < size; index++) { 128 mArray[index] = (String )_methodParamList.elementAt(index); 129 } 130 return mArray; 131 } 133 136 public int getMethodParamCount() 137 { 138 return _methodParamList.size(); 139 } 141 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 } 155 160 public void marshal(java.io.Writer out) 161 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 162 { 163 164 Marshaller.marshal(this, out); 165 } 167 172 public void marshal(org.xml.sax.ContentHandler handler) 173 throws java.io.IOException , org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 174 { 175 176 Marshaller.marshal(this, handler); 177 } 179 182 public void removeAllMethodParam() 183 { 184 _methodParamList.removeAllElements(); 185 } 187 192 public java.lang.String removeMethodParam(int index) 193 { 194 java.lang.Object obj = _methodParamList.elementAt(index); 195 _methodParamList.removeElementAt(index); 196 return (String )obj; 197 } 199 204 public void setId(java.lang.String id) 205 { 206 this._id = id; 207 } 209 215 public void setMethodParam(int index, java.lang.String vMethodParam) 216 throws java.lang.IndexOutOfBoundsException 217 { 218 if ((index < 0) || (index > _methodParamList.size())) { 220 throw new IndexOutOfBoundsException (); 221 } 222 _methodParamList.setElementAt(vMethodParam, index); 223 } 225 230 public void setMethodParam(java.lang.String [] methodParamArray) 231 { 232 _methodParamList.removeAllElements(); 234 for (int i = 0; i < methodParamArray.length; i++) { 235 _methodParamList.addElement(methodParamArray[i]); 236 } 237 } 239 244 public static java.lang.Object unmarshal(java.io.Reader reader) 245 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 246 { 247 return (org.openejb.alt.config.ejb11.MethodParams) Unmarshaller.unmarshal(org.openejb.alt.config.ejb11.MethodParams.class, reader); 248 } 250 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 } 260 } 261 | Popular Tags |