/ojc-core/component-common/xsdmodel/src/org/exolab/castor/mapping/xml/Sql.java

https://bitbucket.org/pymma/openesb-components · Java · 462 lines · 245 code · 61 blank · 156 comment · 18 complexity · c291de35e7e61679c4f53538a5eda134 MD5 · raw file

  1. /*
  2. * This class was automatically generated with
  3. * <a href="http://castor.exolab.org">Castor 0.8.12</a>, using an
  4. * XML Schema.
  5. *
  6. * Hand modified by Thomas Yip <yip@intalio.com> based on a patch
  7. * submitted by Jakob Braeuchi [jbraeuchi@hotmail.com].
  8. *
  9. *
  10. */
  11. package org.exolab.castor.mapping.xml;
  12. //---------------------------------/
  13. //- Imported classes and packages -/
  14. //---------------------------------/
  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.mapping.xml.types.DirtyType;
  21. import org.exolab.castor.xml.*;
  22. import org.exolab.castor.xml.MarshalException;
  23. import org.exolab.castor.xml.ValidationException;
  24. import org.xml.sax.DocumentHandler;
  25. /**
  26. *
  27. * @version
  28. **/
  29. public class Sql implements java.io.Serializable {
  30. //--------------------------/
  31. //- Class/Member Variables -/
  32. //--------------------------/
  33. private java.util.Vector _name;
  34. private java.util.Vector _type;
  35. private java.lang.String _manyTable;
  36. private java.util.Vector _manyKey;
  37. private org.exolab.castor.mapping.xml.types.DirtyType _dirty = org.exolab.castor.mapping.xml.types.DirtyType.valueOf("check");;
  38. private boolean _readonly;
  39. //----------------/
  40. //- Constructors -/
  41. //----------------/
  42. public Sql() {
  43. super();
  44. _name = new Vector();
  45. _type = new Vector();
  46. _manyKey = new Vector();
  47. } //-- org.exolab.castor.mapping.xml.Sql()
  48. //-----------/
  49. //- Methods -/
  50. //-----------/
  51. /**
  52. *
  53. * @param vManyKey
  54. **/
  55. public void addManyKey(java.lang.String vManyKey)
  56. throws java.lang.IndexOutOfBoundsException
  57. {
  58. _manyKey.addElement(vManyKey);
  59. } //-- void addManyKey(java.lang.String)
  60. /**
  61. *
  62. * @param vName
  63. **/
  64. public void addName(java.lang.String vName)
  65. throws java.lang.IndexOutOfBoundsException
  66. {
  67. _name.addElement(vName);
  68. } //-- void addName(java.lang.String)
  69. /**
  70. *
  71. * @param vType
  72. **/
  73. public void addType(java.lang.String vType)
  74. throws java.lang.IndexOutOfBoundsException
  75. {
  76. _type.addElement(vType);
  77. } //-- void addType(java.lang.String)
  78. /**
  79. **/
  80. public java.util.Enumeration enumerateManyKey()
  81. {
  82. return _manyKey.elements();
  83. } //-- java.util.Enumeration enumerateManyKey()
  84. /**
  85. **/
  86. public java.util.Enumeration enumerateName()
  87. {
  88. return _name.elements();
  89. } //-- java.util.Enumeration enumerateName()
  90. /**
  91. **/
  92. public java.util.Enumeration enumerateType()
  93. {
  94. return _type.elements();
  95. } //-- java.util.Enumeration enumerateType()
  96. /**
  97. **/
  98. public org.exolab.castor.mapping.xml.types.DirtyType getDirty()
  99. {
  100. return this._dirty;
  101. } //-- org.exolab.castor.mapping.xml.types.DirtyType getDirty()
  102. /**
  103. *
  104. * @param index
  105. **/
  106. public java.lang.String getManyKey(int index)
  107. throws java.lang.IndexOutOfBoundsException
  108. {
  109. //-- check bounds for index
  110. if ((index < 0) || (index > _manyKey.size())) {
  111. throw new IndexOutOfBoundsException();
  112. }
  113. return (String)_manyKey.elementAt(index);
  114. } //-- java.lang.String getManyKey(int)
  115. /**
  116. **/
  117. public java.lang.String[] getManyKey()
  118. {
  119. int size = _manyKey.size();
  120. java.lang.String[] mArray = new String[size];
  121. for (int index = 0; index < size; index++) {
  122. mArray[index] = (String)_manyKey.elementAt(index);
  123. }
  124. return mArray;
  125. } //-- java.lang.String[] getManyKey()
  126. /**
  127. **/
  128. public int getManyKeyCount()
  129. {
  130. return _manyKey.size();
  131. } //-- int getManyKeyCount()
  132. /**
  133. **/
  134. public java.lang.String getManyTable()
  135. {
  136. return this._manyTable;
  137. } //-- java.lang.String getManyTable()
  138. /**
  139. **/
  140. public boolean getReadonly()
  141. {
  142. return this._readonly;
  143. } //-- boolean getReadonly()
  144. /**
  145. *
  146. * @param _readonly
  147. **/
  148. public void setReadonly(boolean _readonly)
  149. {
  150. this._readonly = _readonly;
  151. } //-- void setReadonly(boolean)
  152. /**
  153. *
  154. * @param index
  155. **/
  156. public java.lang.String getName(int index)
  157. throws java.lang.IndexOutOfBoundsException
  158. {
  159. //-- check bounds for index
  160. if ((index < 0) || (index > _name.size())) {
  161. throw new IndexOutOfBoundsException();
  162. }
  163. return (String)_name.elementAt(index);
  164. } //-- java.lang.String getName(int)
  165. /**
  166. **/
  167. public java.lang.String[] getName()
  168. {
  169. int size = _name.size();
  170. java.lang.String[] mArray = new String[size];
  171. for (int index = 0; index < size; index++) {
  172. mArray[index] = (String)_name.elementAt(index);
  173. }
  174. return mArray;
  175. } //-- java.lang.String[] getName()
  176. /**
  177. **/
  178. public int getNameCount()
  179. {
  180. return _name.size();
  181. } //-- int getNameCount()
  182. /**
  183. *
  184. * @param index
  185. **/
  186. public java.lang.String getType(int index)
  187. throws java.lang.IndexOutOfBoundsException
  188. {
  189. //-- check bounds for index
  190. if ((index < 0) || (index > _type.size())) {
  191. throw new IndexOutOfBoundsException();
  192. }
  193. return (String)_type.elementAt(index);
  194. } //-- java.lang.String getType(int)
  195. /**
  196. **/
  197. public java.lang.String[] getType()
  198. {
  199. int size = _type.size();
  200. java.lang.String[] mArray = new String[size];
  201. for (int index = 0; index < size; index++) {
  202. mArray[index] = (String)_type.elementAt(index);
  203. }
  204. return mArray;
  205. } //-- java.lang.String[] getType()
  206. /**
  207. **/
  208. public int getTypeCount()
  209. {
  210. return _type.size();
  211. } //-- int getTypeCount()
  212. /**
  213. **/
  214. public boolean isValid()
  215. {
  216. try {
  217. validate();
  218. }
  219. catch (org.exolab.castor.xml.ValidationException vex) {
  220. return false;
  221. }
  222. return true;
  223. } //-- boolean isValid()
  224. /**
  225. *
  226. * @param out
  227. **/
  228. public void marshal(java.io.Writer out)
  229. throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
  230. {
  231. Marshaller.marshal(this, out);
  232. } //-- void marshal(java.io.Writer)
  233. /**
  234. *
  235. * @param handler
  236. **/
  237. public void marshal(org.xml.sax.DocumentHandler handler)
  238. throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
  239. {
  240. Marshaller.marshal(this, handler);
  241. } //-- void marshal(org.xml.sax.DocumentHandler)
  242. /**
  243. **/
  244. public void removeAllManyKey()
  245. {
  246. _manyKey.removeAllElements();
  247. } //-- void removeAllManyKey()
  248. /**
  249. **/
  250. public void removeAllName()
  251. {
  252. _name.removeAllElements();
  253. } //-- void removeAllName()
  254. /**
  255. **/
  256. public void removeAllType()
  257. {
  258. _type.removeAllElements();
  259. } //-- void removeAllType()
  260. /**
  261. *
  262. * @param index
  263. **/
  264. public java.lang.String removeManyKey(int index)
  265. {
  266. Object obj = _manyKey.elementAt(index);
  267. _manyKey.removeElementAt(index);
  268. return (String)obj;
  269. } //-- java.lang.String removeManyKey(int)
  270. /**
  271. *
  272. * @param index
  273. **/
  274. public java.lang.String removeName(int index)
  275. {
  276. Object obj = _name.elementAt(index);
  277. _name.removeElementAt(index);
  278. return (String)obj;
  279. } //-- java.lang.String removeName(int)
  280. /**
  281. *
  282. * @param index
  283. **/
  284. public java.lang.String removeType(int index)
  285. {
  286. Object obj = _type.elementAt(index);
  287. _type.removeElementAt(index);
  288. return (String)obj;
  289. } //-- java.lang.String removeType(int)
  290. /**
  291. *
  292. * @param _dirty
  293. **/
  294. public void setDirty(org.exolab.castor.mapping.xml.types.DirtyType _dirty)
  295. {
  296. this._dirty = _dirty;
  297. } //-- void setDirty(org.exolab.castor.mapping.xml.types.DirtyType)
  298. /**
  299. *
  300. * @param vManyKey
  301. * @param index
  302. **/
  303. public void setManyKey(java.lang.String vManyKey, int index)
  304. throws java.lang.IndexOutOfBoundsException
  305. {
  306. //-- check bounds for index
  307. if ((index < 0) || (index > _manyKey.size())) {
  308. throw new IndexOutOfBoundsException();
  309. }
  310. _manyKey.setElementAt(vManyKey, index);
  311. } //-- void setManyKey(java.lang.String, int)
  312. /**
  313. *
  314. * @param manyKeyArray
  315. **/
  316. public void setManyKey(java.lang.String[] manyKeyArray)
  317. {
  318. //-- copy array
  319. _manyKey.removeAllElements();
  320. for (int i = 0; i < manyKeyArray.length; i++) {
  321. _manyKey.addElement(manyKeyArray[i]);
  322. }
  323. } //-- void setManyKey(java.lang.String)
  324. /**
  325. *
  326. * @param _manyTable
  327. **/
  328. public void setManyTable(java.lang.String _manyTable)
  329. {
  330. this._manyTable = _manyTable;
  331. } //-- void setManyTable(java.lang.String)
  332. /**
  333. *
  334. * @param vName
  335. * @param index
  336. **/
  337. public void setName(java.lang.String vName, int index)
  338. throws java.lang.IndexOutOfBoundsException
  339. {
  340. //-- check bounds for index
  341. if ((index < 0) || (index > _name.size())) {
  342. throw new IndexOutOfBoundsException();
  343. }
  344. _name.setElementAt(vName, index);
  345. } //-- void setName(java.lang.String, int)
  346. /**
  347. *
  348. * @param nameArray
  349. **/
  350. public void setName(java.lang.String[] nameArray)
  351. {
  352. //-- copy array
  353. _name.removeAllElements();
  354. for (int i = 0; i < nameArray.length; i++) {
  355. _name.addElement(nameArray[i]);
  356. }
  357. } //-- void setName(java.lang.String)
  358. /**
  359. *
  360. * @param vType
  361. * @param index
  362. **/
  363. public void setType(java.lang.String vType, int index)
  364. throws java.lang.IndexOutOfBoundsException
  365. {
  366. //-- check bounds for index
  367. if ((index < 0) || (index > _type.size())) {
  368. throw new IndexOutOfBoundsException();
  369. }
  370. _type.setElementAt(vType, index);
  371. } //-- void setType(java.lang.String, int)
  372. /**
  373. *
  374. * @param typeArray
  375. **/
  376. public void setType(java.lang.String[] typeArray)
  377. {
  378. //-- copy array
  379. _type.removeAllElements();
  380. for (int i = 0; i < typeArray.length; i++) {
  381. _type.addElement(typeArray[i]);
  382. }
  383. } //-- void setType(java.lang.String)
  384. /**
  385. *
  386. * @param reader
  387. **/
  388. public static org.exolab.castor.mapping.xml.Sql unmarshal(java.io.Reader reader)
  389. throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
  390. {
  391. return (org.exolab.castor.mapping.xml.Sql) Unmarshaller.unmarshal(org.exolab.castor.mapping.xml.Sql.class, reader);
  392. } //-- org.exolab.castor.mapping.xml.Sql unmarshal(java.io.Reader)
  393. /**
  394. **/
  395. public void validate()
  396. throws org.exolab.castor.xml.ValidationException
  397. {
  398. Validator validator = new Validator();
  399. validator.validate(this);
  400. } //-- void validate()
  401. }