Samples JDK
ItemsImpl.java
1 /*
2  * XML Type: Items
3  * Namespace: http://www.freemindcafe.com/purchase3
4  * Java type: com.freemindcafe.purchase3.Items
5  *
6  * Automatically generated - do not modify.
7  */
8 package com.freemindcafe.purchase3.impl;
9 /**
10  * An XML Items(@http://www.freemindcafe.com/purchase3).
11  *
12  * This is a complex type.
13  */
14 public class ItemsImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.freemindcafe.purchase3.Items
15 {
16  private static final long serialVersionUID = 1L;
17 
18  public ItemsImpl(org.apache.xmlbeans.SchemaType sType)
19  {
20  super(sType);
21  }
22 
23  private static final javax.xml.namespace.QName ITEM$0 =
24  new javax.xml.namespace.QName("http://www.freemindcafe.com/purchase3", "item");
25 
26 
27  /**
28  * Gets a List of "item" elements
29  */
30  public java.util.List<com.freemindcafe.purchase3.Items.Item> getItemList()
31  {
32  final class ItemList extends java.util.AbstractList<com.freemindcafe.purchase3.Items.Item>
33  {
34  @Override
35  public com.freemindcafe.purchase3.Items.Item get(int i)
36  { return ItemsImpl.this.getItemArray(i); }
37 
38  @Override
40  {
42  ItemsImpl.this.setItemArray(i, o);
43  return old;
44  }
45 
46  @Override
47  public void add(int i, com.freemindcafe.purchase3.Items.Item o)
48  { ItemsImpl.this.insertNewItem(i).set(o); }
49 
50  @Override
51  public com.freemindcafe.purchase3.Items.Item remove(int i)
52  {
54  ItemsImpl.this.removeItem(i);
55  return old;
56  }
57 
58  @Override
59  public int size()
60  { return ItemsImpl.this.sizeOfItemArray(); }
61 
62  }
63 
64  synchronized (monitor())
65  {
66  check_orphaned();
67  return new ItemList();
68  }
69  }
70 
71  /**
72  * Gets array of all "item" elements
73  * @deprecated
74  */
75  @Deprecated
77  {
78  synchronized (monitor())
79  {
80  check_orphaned();
81  java.util.List<com.freemindcafe.purchase3.Items.Item> targetList = new java.util.ArrayList<com.freemindcafe.purchase3.Items.Item>();
82  get_store().find_all_element_users(ITEM$0, targetList);
83  com.freemindcafe.purchase3.Items.Item[] result = new com.freemindcafe.purchase3.Items.Item[targetList.size()];
84  targetList.toArray(result);
85  return result;
86  }
87  }
88 
89  /**
90  * Gets ith "item" element
91  */
93  {
94  synchronized (monitor())
95  {
96  check_orphaned();
97  com.freemindcafe.purchase3.Items.Item target = null;
98  target = (com.freemindcafe.purchase3.Items.Item)get_store().find_element_user(ITEM$0, i);
99  if (target == null)
100  {
101  throw new IndexOutOfBoundsException();
102  }
103  return target;
104  }
105  }
106 
107  /**
108  * Returns number of "item" element
109  */
110  public int sizeOfItemArray()
111  {
112  synchronized (monitor())
113  {
114  check_orphaned();
115  return get_store().count_elements(ITEM$0);
116  }
117  }
118 
119  /**
120  * Sets array of all "item" element WARNING: This method is not atomicaly synchronized.
121  */
122  public void setItemArray(com.freemindcafe.purchase3.Items.Item[] itemArray)
123  {
124  check_orphaned();
125  arraySetterHelper(itemArray, ITEM$0);
126  }
127 
128  /**
129  * Sets ith "item" element
130  */
131  public void setItemArray(int i, com.freemindcafe.purchase3.Items.Item item)
132  {
133  synchronized (monitor())
134  {
135  check_orphaned();
136  com.freemindcafe.purchase3.Items.Item target = null;
137  target = (com.freemindcafe.purchase3.Items.Item)get_store().find_element_user(ITEM$0, i);
138  if (target == null)
139  {
140  throw new IndexOutOfBoundsException();
141  }
142  target.set(item);
143  }
144  }
145 
146  /**
147  * Inserts and returns a new empty value (as xml) as the ith "item" element
148  */
150  {
151  synchronized (monitor())
152  {
153  check_orphaned();
154  com.freemindcafe.purchase3.Items.Item target = null;
155  target = (com.freemindcafe.purchase3.Items.Item)get_store().insert_element_user(ITEM$0, i);
156  return target;
157  }
158  }
159 
160  /**
161  * Appends and returns a new empty value (as xml) as the last "item" element
162  */
164  {
165  synchronized (monitor())
166  {
167  check_orphaned();
168  com.freemindcafe.purchase3.Items.Item target = null;
169  target = (com.freemindcafe.purchase3.Items.Item)get_store().add_element_user(ITEM$0);
170  return target;
171  }
172  }
173 
174  /**
175  * Removes the ith "item" element
176  */
177  public void removeItem(int i)
178  {
179  synchronized (monitor())
180  {
181  check_orphaned();
182  get_store().remove_element(ITEM$0, i);
183  }
184  }
185  /**
186  * An XML item(@http://www.freemindcafe.com/purchase3).
187  *
188  * This is a complex type.
189  */
190  public static class ItemImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.freemindcafe.purchase3.Items.Item
191  {
192  private static final long serialVersionUID = 1L;
193 
194  public ItemImpl(org.apache.xmlbeans.SchemaType sType)
195  {
196  super(sType);
197  }
198 
199  private static final javax.xml.namespace.QName PRODUCTNAME$0 =
200  new javax.xml.namespace.QName("http://www.freemindcafe.com/purchase3", "productName");
201  private static final javax.xml.namespace.QName QUANTITY$2 =
202  new javax.xml.namespace.QName("http://www.freemindcafe.com/purchase3", "quantity");
203  private static final javax.xml.namespace.QName USPRICE$4 =
204  new javax.xml.namespace.QName("http://www.freemindcafe.com/purchase3", "USPrice");
205  private static final javax.xml.namespace.QName COMMENT$6 =
206  new javax.xml.namespace.QName("http://www.freemindcafe.com/purchase3", "comment");
207  private static final javax.xml.namespace.QName SHIPDATE$8 =
208  new javax.xml.namespace.QName("http://www.freemindcafe.com/purchase3", "shipDate");
209  private static final javax.xml.namespace.QName PARTNUM$10 =
210  new javax.xml.namespace.QName("", "partNum");
211 
212 
213  /**
214  * Gets the "productName" element
215  */
216  public java.lang.String getProductName()
217  {
218  synchronized (monitor())
219  {
220  check_orphaned();
221  org.apache.xmlbeans.SimpleValue target = null;
222  target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(PRODUCTNAME$0, 0);
223  if (target == null)
224  {
225  return null;
226  }
227  return target.getStringValue();
228  }
229  }
230 
231  /**
232  * Gets (as xml) the "productName" element
233  */
234  public org.apache.xmlbeans.XmlString xgetProductName()
235  {
236  synchronized (monitor())
237  {
238  check_orphaned();
239  org.apache.xmlbeans.XmlString target = null;
240  target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(PRODUCTNAME$0, 0);
241  return target;
242  }
243  }
244 
245  /**
246  * Sets the "productName" element
247  */
248  public void setProductName(java.lang.String productName)
249  {
250  synchronized (monitor())
251  {
252  check_orphaned();
253  org.apache.xmlbeans.SimpleValue target = null;
254  target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(PRODUCTNAME$0, 0);
255  if (target == null)
256  {
257  target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(PRODUCTNAME$0);
258  }
259  target.setStringValue(productName);
260  }
261  }
262 
263  /**
264  * Sets (as xml) the "productName" element
265  */
266  public void xsetProductName(org.apache.xmlbeans.XmlString productName)
267  {
268  synchronized (monitor())
269  {
270  check_orphaned();
271  org.apache.xmlbeans.XmlString target = null;
272  target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(PRODUCTNAME$0, 0);
273  if (target == null)
274  {
275  target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(PRODUCTNAME$0);
276  }
277  target.set(productName);
278  }
279  }
280 
281  /**
282  * Gets the "quantity" element
283  */
284  public int getQuantity()
285  {
286  synchronized (monitor())
287  {
288  check_orphaned();
289  org.apache.xmlbeans.SimpleValue target = null;
290  target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(QUANTITY$2, 0);
291  if (target == null)
292  {
293  return 0;
294  }
295  return target.getIntValue();
296  }
297  }
298 
299  /**
300  * Gets (as xml) the "quantity" element
301  */
302  public com.freemindcafe.purchase3.Items.Item.Quantity xgetQuantity()
303  {
304  synchronized (monitor())
305  {
306  check_orphaned();
308  target = (com.freemindcafe.purchase3.Items.Item.Quantity)get_store().find_element_user(QUANTITY$2, 0);
309  return target;
310  }
311  }
312 
313  /**
314  * Sets the "quantity" element
315  */
316  public void setQuantity(int quantity)
317  {
318  synchronized (monitor())
319  {
320  check_orphaned();
321  org.apache.xmlbeans.SimpleValue target = null;
322  target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(QUANTITY$2, 0);
323  if (target == null)
324  {
325  target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(QUANTITY$2);
326  }
327  target.setIntValue(quantity);
328  }
329  }
330 
331  /**
332  * Sets (as xml) the "quantity" element
333  */
334  public void xsetQuantity(com.freemindcafe.purchase3.Items.Item.Quantity quantity)
335  {
336  synchronized (monitor())
337  {
338  check_orphaned();
340  target = (com.freemindcafe.purchase3.Items.Item.Quantity)get_store().find_element_user(QUANTITY$2, 0);
341  if (target == null)
342  {
343  target = (com.freemindcafe.purchase3.Items.Item.Quantity)get_store().add_element_user(QUANTITY$2);
344  }
345  target.set(quantity);
346  }
347  }
348 
349  /**
350  * Gets the "USPrice" element
351  */
352  public java.math.BigDecimal getUSPrice()
353  {
354  synchronized (monitor())
355  {
356  check_orphaned();
357  org.apache.xmlbeans.SimpleValue target = null;
358  target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(USPRICE$4, 0);
359  if (target == null)
360  {
361  return null;
362  }
363  return target.getBigDecimalValue();
364  }
365  }
366 
367  /**
368  * Gets (as xml) the "USPrice" element
369  */
370  public org.apache.xmlbeans.XmlDecimal xgetUSPrice()
371  {
372  synchronized (monitor())
373  {
374  check_orphaned();
375  org.apache.xmlbeans.XmlDecimal target = null;
376  target = (org.apache.xmlbeans.XmlDecimal)get_store().find_element_user(USPRICE$4, 0);
377  return target;
378  }
379  }
380 
381  /**
382  * Sets the "USPrice" element
383  */
384  public void setUSPrice(java.math.BigDecimal usPrice)
385  {
386  synchronized (monitor())
387  {
388  check_orphaned();
389  org.apache.xmlbeans.SimpleValue target = null;
390  target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(USPRICE$4, 0);
391  if (target == null)
392  {
393  target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(USPRICE$4);
394  }
395  target.setBigDecimalValue(usPrice);
396  }
397  }
398 
399  /**
400  * Sets (as xml) the "USPrice" element
401  */
402  public void xsetUSPrice(org.apache.xmlbeans.XmlDecimal usPrice)
403  {
404  synchronized (monitor())
405  {
406  check_orphaned();
407  org.apache.xmlbeans.XmlDecimal target = null;
408  target = (org.apache.xmlbeans.XmlDecimal)get_store().find_element_user(USPRICE$4, 0);
409  if (target == null)
410  {
411  target = (org.apache.xmlbeans.XmlDecimal)get_store().add_element_user(USPRICE$4);
412  }
413  target.set(usPrice);
414  }
415  }
416 
417  /**
418  * Gets the "comment" element
419  */
420  public java.lang.String getComment()
421  {
422  synchronized (monitor())
423  {
424  check_orphaned();
425  org.apache.xmlbeans.SimpleValue target = null;
426  target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(COMMENT$6, 0);
427  if (target == null)
428  {
429  return null;
430  }
431  return target.getStringValue();
432  }
433  }
434 
435  /**
436  * Gets (as xml) the "comment" element
437  */
438  public org.apache.xmlbeans.XmlString xgetComment()
439  {
440  synchronized (monitor())
441  {
442  check_orphaned();
443  org.apache.xmlbeans.XmlString target = null;
444  target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(COMMENT$6, 0);
445  return target;
446  }
447  }
448 
449  /**
450  * True if has "comment" element
451  */
452  public boolean isSetComment()
453  {
454  synchronized (monitor())
455  {
456  check_orphaned();
457  return get_store().count_elements(COMMENT$6) != 0;
458  }
459  }
460 
461  /**
462  * Sets the "comment" element
463  */
464  public void setComment(java.lang.String comment)
465  {
466  synchronized (monitor())
467  {
468  check_orphaned();
469  org.apache.xmlbeans.SimpleValue target = null;
470  target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(COMMENT$6, 0);
471  if (target == null)
472  {
473  target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(COMMENT$6);
474  }
475  target.setStringValue(comment);
476  }
477  }
478 
479  /**
480  * Sets (as xml) the "comment" element
481  */
482  public void xsetComment(org.apache.xmlbeans.XmlString comment)
483  {
484  synchronized (monitor())
485  {
486  check_orphaned();
487  org.apache.xmlbeans.XmlString target = null;
488  target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(COMMENT$6, 0);
489  if (target == null)
490  {
491  target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(COMMENT$6);
492  }
493  target.set(comment);
494  }
495  }
496 
497  /**
498  * Unsets the "comment" element
499  */
500  public void unsetComment()
501  {
502  synchronized (monitor())
503  {
504  check_orphaned();
505  get_store().remove_element(COMMENT$6, 0);
506  }
507  }
508 
509  /**
510  * Gets the "shipDate" element
511  */
512  public java.util.Calendar getShipDate()
513  {
514  synchronized (monitor())
515  {
516  check_orphaned();
517  org.apache.xmlbeans.SimpleValue target = null;
518  target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SHIPDATE$8, 0);
519  if (target == null)
520  {
521  return null;
522  }
523  return target.getCalendarValue();
524  }
525  }
526 
527  /**
528  * Gets (as xml) the "shipDate" element
529  */
530  public org.apache.xmlbeans.XmlDate xgetShipDate()
531  {
532  synchronized (monitor())
533  {
534  check_orphaned();
535  org.apache.xmlbeans.XmlDate target = null;
536  target = (org.apache.xmlbeans.XmlDate)get_store().find_element_user(SHIPDATE$8, 0);
537  return target;
538  }
539  }
540 
541  /**
542  * True if has "shipDate" element
543  */
544  public boolean isSetShipDate()
545  {
546  synchronized (monitor())
547  {
548  check_orphaned();
549  return get_store().count_elements(SHIPDATE$8) != 0;
550  }
551  }
552 
553  /**
554  * Sets the "shipDate" element
555  */
556  public void setShipDate(java.util.Calendar shipDate)
557  {
558  synchronized (monitor())
559  {
560  check_orphaned();
561  org.apache.xmlbeans.SimpleValue target = null;
562  target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SHIPDATE$8, 0);
563  if (target == null)
564  {
565  target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(SHIPDATE$8);
566  }
567  target.setCalendarValue(shipDate);
568  }
569  }
570 
571  /**
572  * Sets (as xml) the "shipDate" element
573  */
574  public void xsetShipDate(org.apache.xmlbeans.XmlDate shipDate)
575  {
576  synchronized (monitor())
577  {
578  check_orphaned();
579  org.apache.xmlbeans.XmlDate target = null;
580  target = (org.apache.xmlbeans.XmlDate)get_store().find_element_user(SHIPDATE$8, 0);
581  if (target == null)
582  {
583  target = (org.apache.xmlbeans.XmlDate)get_store().add_element_user(SHIPDATE$8);
584  }
585  target.set(shipDate);
586  }
587  }
588 
589  /**
590  * Unsets the "shipDate" element
591  */
592  public void unsetShipDate()
593  {
594  synchronized (monitor())
595  {
596  check_orphaned();
597  get_store().remove_element(SHIPDATE$8, 0);
598  }
599  }
600 
601  /**
602  * Gets the "partNum" attribute
603  */
604  public java.lang.String getPartNum()
605  {
606  synchronized (monitor())
607  {
608  check_orphaned();
609  org.apache.xmlbeans.SimpleValue target = null;
610  target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(PARTNUM$10);
611  if (target == null)
612  {
613  return null;
614  }
615  return target.getStringValue();
616  }
617  }
618 
619  /**
620  * Gets (as xml) the "partNum" attribute
621  */
622  public com.freemindcafe.purchase3.SKU xgetPartNum()
623  {
624  synchronized (monitor())
625  {
626  check_orphaned();
627  com.freemindcafe.purchase3.SKU target = null;
628  target = (com.freemindcafe.purchase3.SKU)get_store().find_attribute_user(PARTNUM$10);
629  return target;
630  }
631  }
632 
633  /**
634  * Sets the "partNum" attribute
635  */
636  public void setPartNum(java.lang.String partNum)
637  {
638  synchronized (monitor())
639  {
640  check_orphaned();
641  org.apache.xmlbeans.SimpleValue target = null;
642  target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(PARTNUM$10);
643  if (target == null)
644  {
645  target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(PARTNUM$10);
646  }
647  target.setStringValue(partNum);
648  }
649  }
650 
651  /**
652  * Sets (as xml) the "partNum" attribute
653  */
654  public void xsetPartNum(com.freemindcafe.purchase3.SKU partNum)
655  {
656  synchronized (monitor())
657  {
658  check_orphaned();
659  com.freemindcafe.purchase3.SKU target = null;
660  target = (com.freemindcafe.purchase3.SKU)get_store().find_attribute_user(PARTNUM$10);
661  if (target == null)
662  {
663  target = (com.freemindcafe.purchase3.SKU)get_store().add_attribute_user(PARTNUM$10);
664  }
665  target.set(partNum);
666  }
667  }
668  /**
669  * An XML quantity(@http://www.freemindcafe.com/purchase3).
670  *
671  * This is an atomic type that is a restriction of com.freemindcafe.purchase3.Items$Item$Quantity.
672  */
673  public static class QuantityImpl extends org.apache.xmlbeans.impl.values.JavaIntHolderEx implements com.freemindcafe.purchase3.Items.Item.Quantity
674  {
675  private static final long serialVersionUID = 1L;
676 
677  public QuantityImpl(org.apache.xmlbeans.SchemaType sType)
678  {
679  super(sType, false);
680  }
681 
682  protected QuantityImpl(org.apache.xmlbeans.SchemaType sType, boolean b)
683  {
684  super(sType, b);
685  }
686  }
687  }
688 }
com.freemindcafe.purchase3.Items.Item[] getItemArray()
Definition: ItemsImpl.java:76
com.freemindcafe.purchase3.Items.Item getItemArray(int i)
Definition: ItemsImpl.java:92
void setItemArray(com.freemindcafe.purchase3.Items.Item[] itemArray)
Definition: ItemsImpl.java:122
com.freemindcafe.purchase3.Items.Item insertNewItem(int i)
Definition: ItemsImpl.java:149
com.freemindcafe.purchase3.Items.Item addNewItem()
Definition: ItemsImpl.java:163
void setItemArray(int i, com.freemindcafe.purchase3.Items.Item item)
Definition: ItemsImpl.java:131
java.util.List< com.freemindcafe.purchase3.Items.Item > getItemList()
Definition: ItemsImpl.java:30