/projects/castor-1.3.3/xmlctf-framework/target/generated-sources/castor/org/exolab/castor/tests/framework/testDescriptor/BugFix.java

https://gitlab.com/essere.lab.public/qualitas.class-corpus · Java · 383 lines · 140 code · 43 blank · 200 comment · 5 complexity · e9428c9d595ea2f56cfc8b17471a6819 MD5 · raw file

  1. /*
  2. * This class was automatically generated with
  3. * <a href="http://www.castor.org">Castor 1.3.1</a>, using an XML
  4. * Schema.
  5. * $Id$
  6. */
  7. package org.exolab.castor.tests.framework.testDescriptor;
  8. /**
  9. * Encapsulates information about a bug fix, including the
  10. * reporter's
  11. * name (or Email address), the date of the report and of the fix,
  12. * and one or more comments about the bug.
  13. *
  14. *
  15. * @version $Revision$ $Date$
  16. */
  17. public class BugFix implements java.io.Serializable {
  18. //--------------------------/
  19. //- Class/Member Variables -/
  20. //--------------------------/
  21. /**
  22. * Field _reporter.
  23. */
  24. private java.lang.String _reporter;
  25. /**
  26. * Field _issue.
  27. */
  28. private java.lang.String _issue;
  29. /**
  30. * Field _date_Report.
  31. */
  32. private org.exolab.castor.types.Date _date_Report;
  33. /**
  34. * Field _date_Fix.
  35. */
  36. private org.exolab.castor.types.Date _date_Fix;
  37. /**
  38. * Field _commentList.
  39. */
  40. private java.util.List _commentList;
  41. //----------------/
  42. //- Constructors -/
  43. //----------------/
  44. public BugFix() {
  45. super();
  46. this._commentList = new java.util.ArrayList();
  47. }
  48. //-----------/
  49. //- Methods -/
  50. //-----------/
  51. /**
  52. *
  53. *
  54. * @param vComment
  55. * @throws java.lang.IndexOutOfBoundsException if the index
  56. * given is outside the bounds of the collection
  57. */
  58. public void addComment(
  59. final java.lang.String vComment)
  60. throws java.lang.IndexOutOfBoundsException {
  61. this._commentList.add(vComment);
  62. }
  63. /**
  64. *
  65. *
  66. * @param index
  67. * @param vComment
  68. * @throws java.lang.IndexOutOfBoundsException if the index
  69. * given is outside the bounds of the collection
  70. */
  71. public void addComment(
  72. final int index,
  73. final java.lang.String vComment)
  74. throws java.lang.IndexOutOfBoundsException {
  75. this._commentList.add(index, vComment);
  76. }
  77. /**
  78. * Method enumerateComment.
  79. *
  80. * @return an Enumeration over all possible elements of this
  81. * collection
  82. */
  83. public java.util.Enumeration enumerateComment(
  84. ) {
  85. return java.util.Collections.enumeration(this._commentList);
  86. }
  87. /**
  88. * Method getComment.
  89. *
  90. * @param index
  91. * @throws java.lang.IndexOutOfBoundsException if the index
  92. * given is outside the bounds of the collection
  93. * @return the value of the java.lang.String at the given index
  94. */
  95. public java.lang.String getComment(
  96. final int index)
  97. throws java.lang.IndexOutOfBoundsException {
  98. // check bounds for index
  99. if (index < 0 || index >= this._commentList.size()) {
  100. throw new IndexOutOfBoundsException("getComment: Index value '" + index + "' not in range [0.." + (this._commentList.size() - 1) + "]");
  101. }
  102. return (java.lang.String) _commentList.get(index);
  103. }
  104. /**
  105. * Method getComment.Returns the contents of the collection in
  106. * an Array. <p>Note: Just in case the collection contents
  107. * are changing in another thread, we pass a 0-length Array of
  108. * the correct type into the API call. This way we <i>know</i>
  109. * that the Array returned is of exactly the correct length.
  110. *
  111. * @return this collection as an Array
  112. */
  113. public java.lang.String[] getComment(
  114. ) {
  115. java.lang.String[] array = new java.lang.String[0];
  116. return (java.lang.String[]) this._commentList.toArray(array);
  117. }
  118. /**
  119. * Method getCommentCount.
  120. *
  121. * @return the size of this collection
  122. */
  123. public int getCommentCount(
  124. ) {
  125. return this._commentList.size();
  126. }
  127. /**
  128. * Returns the value of field 'date_Fix'.
  129. *
  130. * @return the value of field 'Date_Fix'.
  131. */
  132. public org.exolab.castor.types.Date getDate_Fix(
  133. ) {
  134. return this._date_Fix;
  135. }
  136. /**
  137. * Returns the value of field 'date_Report'.
  138. *
  139. * @return the value of field 'Date_Report'.
  140. */
  141. public org.exolab.castor.types.Date getDate_Report(
  142. ) {
  143. return this._date_Report;
  144. }
  145. /**
  146. * Returns the value of field 'issue'.
  147. *
  148. * @return the value of field 'Issue'.
  149. */
  150. public java.lang.String getIssue(
  151. ) {
  152. return this._issue;
  153. }
  154. /**
  155. * Returns the value of field 'reporter'.
  156. *
  157. * @return the value of field 'Reporter'.
  158. */
  159. public java.lang.String getReporter(
  160. ) {
  161. return this._reporter;
  162. }
  163. /**
  164. * Method isValid.
  165. *
  166. * @return true if this object is valid according to the schema
  167. */
  168. public boolean isValid(
  169. ) {
  170. try {
  171. validate();
  172. } catch (org.exolab.castor.xml.ValidationException vex) {
  173. return false;
  174. }
  175. return true;
  176. }
  177. /**
  178. * Method iterateComment.
  179. *
  180. * @return an Iterator over all possible elements in this
  181. * collection
  182. */
  183. public java.util.Iterator iterateComment(
  184. ) {
  185. return this._commentList.iterator();
  186. }
  187. /**
  188. *
  189. *
  190. * @param out
  191. * @throws org.exolab.castor.xml.MarshalException if object is
  192. * null or if any SAXException is thrown during marshaling
  193. * @throws org.exolab.castor.xml.ValidationException if this
  194. * object is an invalid instance according to the schema
  195. */
  196. public void marshal(
  197. final java.io.Writer out)
  198. throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
  199. org.exolab.castor.xml.Marshaller.marshal(this, out);
  200. }
  201. /**
  202. *
  203. *
  204. * @param handler
  205. * @throws java.io.IOException if an IOException occurs during
  206. * marshaling
  207. * @throws org.exolab.castor.xml.ValidationException if this
  208. * object is an invalid instance according to the schema
  209. * @throws org.exolab.castor.xml.MarshalException if object is
  210. * null or if any SAXException is thrown during marshaling
  211. */
  212. public void marshal(
  213. final org.xml.sax.ContentHandler handler)
  214. throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
  215. org.exolab.castor.xml.Marshaller.marshal(this, handler);
  216. }
  217. /**
  218. */
  219. public void removeAllComment(
  220. ) {
  221. this._commentList.clear();
  222. }
  223. /**
  224. * Method removeComment.
  225. *
  226. * @param vComment
  227. * @return true if the object was removed from the collection.
  228. */
  229. public boolean removeComment(
  230. final java.lang.String vComment) {
  231. boolean removed = _commentList.remove(vComment);
  232. return removed;
  233. }
  234. /**
  235. * Method removeCommentAt.
  236. *
  237. * @param index
  238. * @return the element removed from the collection
  239. */
  240. public java.lang.String removeCommentAt(
  241. final int index) {
  242. java.lang.Object obj = this._commentList.remove(index);
  243. return (java.lang.String) obj;
  244. }
  245. /**
  246. *
  247. *
  248. * @param index
  249. * @param vComment
  250. * @throws java.lang.IndexOutOfBoundsException if the index
  251. * given is outside the bounds of the collection
  252. */
  253. public void setComment(
  254. final int index,
  255. final java.lang.String vComment)
  256. throws java.lang.IndexOutOfBoundsException {
  257. // check bounds for index
  258. if (index < 0 || index >= this._commentList.size()) {
  259. throw new IndexOutOfBoundsException("setComment: Index value '" + index + "' not in range [0.." + (this._commentList.size() - 1) + "]");
  260. }
  261. this._commentList.set(index, vComment);
  262. }
  263. /**
  264. *
  265. *
  266. * @param vCommentArray
  267. */
  268. public void setComment(
  269. final java.lang.String[] vCommentArray) {
  270. //-- copy array
  271. _commentList.clear();
  272. for (int i = 0; i < vCommentArray.length; i++) {
  273. this._commentList.add(vCommentArray[i]);
  274. }
  275. }
  276. /**
  277. * Sets the value of field 'date_Fix'.
  278. *
  279. * @param date_Fix the value of field 'date_Fix'.
  280. */
  281. public void setDate_Fix(
  282. final org.exolab.castor.types.Date date_Fix) {
  283. this._date_Fix = date_Fix;
  284. }
  285. /**
  286. * Sets the value of field 'date_Report'.
  287. *
  288. * @param date_Report the value of field 'date_Report'.
  289. */
  290. public void setDate_Report(
  291. final org.exolab.castor.types.Date date_Report) {
  292. this._date_Report = date_Report;
  293. }
  294. /**
  295. * Sets the value of field 'issue'.
  296. *
  297. * @param issue the value of field 'issue'.
  298. */
  299. public void setIssue(
  300. final java.lang.String issue) {
  301. this._issue = issue;
  302. }
  303. /**
  304. * Sets the value of field 'reporter'.
  305. *
  306. * @param reporter the value of field 'reporter'.
  307. */
  308. public void setReporter(
  309. final java.lang.String reporter) {
  310. this._reporter = reporter;
  311. }
  312. /**
  313. * Method unmarshal.
  314. *
  315. * @param reader
  316. * @throws org.exolab.castor.xml.MarshalException if object is
  317. * null or if any SAXException is thrown during marshaling
  318. * @throws org.exolab.castor.xml.ValidationException if this
  319. * object is an invalid instance according to the schema
  320. * @return the unmarshaled
  321. * org.exolab.castor.tests.framework.testDescriptor.BugFix
  322. */
  323. public static org.exolab.castor.tests.framework.testDescriptor.BugFix unmarshal(
  324. final java.io.Reader reader)
  325. throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
  326. return (org.exolab.castor.tests.framework.testDescriptor.BugFix) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.tests.framework.testDescriptor.BugFix.class, reader);
  327. }
  328. /**
  329. *
  330. *
  331. * @throws org.exolab.castor.xml.ValidationException if this
  332. * object is an invalid instance according to the schema
  333. */
  334. public void validate(
  335. )
  336. throws org.exolab.castor.xml.ValidationException {
  337. org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
  338. validator.validate(this);
  339. }
  340. }