1 /*
2 * An XML document type.
3 * Localname: todolist
4 * Namespace: http://xmlbeans.apache.org/samples/validation/todolist
5 * Java type: org.apache.xmlbeans.samples.validation.todolist.TodolistDocument
6 *
7 * Automatically generated - do not modify.
8 */
9 package org.apache.xmlbeans.samples.validation.todolist.impl;
10 /**
11 * A document containing one todolist(@http://xmlbeans.apache.org/samples/validation/todolist) element.
12 *
13 * This is a complex type.
14 */
15 public class TodolistDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.apache.xmlbeans.samples.validation.todolist.TodolistDocument
16 {
17
18 public TodolistDocumentImpl(org.apache.xmlbeans.SchemaType sType)
19 {
20 super(sType);
21 }
22
23 private static final javax.xml.namespace.QName TODOLIST$0 =
24 new javax.xml.namespace.QName("http://xmlbeans.apache.org/samples/validation/todolist", "todolist");
25
26
27 /**
28 * Gets the "todolist" element
29 */
30 public org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist getTodolist()
31 {
32 synchronized (monitor())
33 {
34 check_orphaned();
35 org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist target = null;
36 target = (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist)get_store().find_element_user(TODOLIST$0, 0);
37 if (target == null)
38 {
39 return null;
40 }
41 return target;
42 }
43 }
44
45 /**
46 * Sets the "todolist" element
47 */
48 public void setTodolist(org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist todolist)
49 {
50 synchronized (monitor())
51 {
52 check_orphaned();
53 org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist target = null;
54 target = (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist)get_store().find_element_user(TODOLIST$0, 0);
55 if (target == null)
56 {
57 target = (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist)get_store().add_element_user(TODOLIST$0);
58 }
59 target.set(todolist);
60 }
61 }
62
63 /**
64 * Appends and returns a new empty "todolist" element
65 */
66 public org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist addNewTodolist()
67 {
68 synchronized (monitor())
69 {
70 check_orphaned();
71 org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist target = null;
72 target = (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist)get_store().add_element_user(TODOLIST$0);
73 return target;
74 }
75 }
76 /**
77 * An XML todolist(@http://xmlbeans.apache.org/samples/validation/todolist).
78 *
79 * This is a complex type.
80 */
81 public static class TodolistImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist
82 {
83
84 public TodolistImpl(org.apache.xmlbeans.SchemaType sType)
85 {
86 super(sType);
87 }
88
89 private static final javax.xml.namespace.QName ITEM$0 =
90 new javax.xml.namespace.QName("http://xmlbeans.apache.org/samples/validation/todolist", "item");
91
92
93 /**
94 * Gets array of all "item" elements
95 */
96 public org.apache.xmlbeans.samples.validation.todolist.ItemType[] getItemArray()
97 {
98 synchronized (monitor())
99 {
100 check_orphaned();
101 java.util.List targetList = new java.util.ArrayList();
102 get_store().find_all_element_users(ITEM$0, targetList);
103 org.apache.xmlbeans.samples.validation.todolist.ItemType[] result = new org.apache.xmlbeans.samples.validation.todolist.ItemType[targetList.size()];
104 targetList.toArray(result);
105 return result;
106 }
107 }
108
109 /**
110 * Gets ith "item" element
111 */
112 public org.apache.xmlbeans.samples.validation.todolist.ItemType getItemArray(int i)
113 {
114 synchronized (monitor())
115 {
116 check_orphaned();
117 org.apache.xmlbeans.samples.validation.todolist.ItemType target = null;
118 target = (org.apache.xmlbeans.samples.validation.todolist.ItemType)get_store().find_element_user(ITEM$0, i);
119 if (target == null)
120 {
121 throw new IndexOutOfBoundsException();
122 }
123 return target;
124 }
125 }
126
127 /**
128 * Returns number of "item" element
129 */
130 public int sizeOfItemArray()
131 {
132 synchronized (monitor())
133 {
134 check_orphaned();
135 return get_store().count_elements(ITEM$0);
136 }
137 }
138
139 /**
140 * Sets array of all "item" element
141 */
142 public void setItemArray(org.apache.xmlbeans.samples.validation.todolist.ItemType[] itemArray)
143 {
144 synchronized (monitor())
145 {
146 check_orphaned();
147 arraySetterHelper(itemArray, ITEM$0);
148 }
149 }
150
151 /**
152 * Sets ith "item" element
153 */
154 public void setItemArray(int i, org.apache.xmlbeans.samples.validation.todolist.ItemType item)
155 {
156 synchronized (monitor())
157 {
158 check_orphaned();
159 org.apache.xmlbeans.samples.validation.todolist.ItemType target = null;
160 target = (org.apache.xmlbeans.samples.validation.todolist.ItemType)get_store().find_element_user(ITEM$0, i);
161 if (target == null)
162 {
163 throw new IndexOutOfBoundsException();
164 }
165 target.set(item);
166 }
167 }
168
169 /**
170 * Inserts and returns a new empty value (as xml) as the ith "item" element
171 */
172 public org.apache.xmlbeans.samples.validation.todolist.ItemType insertNewItem(int i)
173 {
174 synchronized (monitor())
175 {
176 check_orphaned();
177 org.apache.xmlbeans.samples.validation.todolist.ItemType target = null;
178 target = (org.apache.xmlbeans.samples.validation.todolist.ItemType)get_store().insert_element_user(ITEM$0, i);
179 return target;
180 }
181 }
182
183 /**
184 * Appends and returns a new empty value (as xml) as the last "item" element
185 */
186 public org.apache.xmlbeans.samples.validation.todolist.ItemType addNewItem()
187 {
188 synchronized (monitor())
189 {
190 check_orphaned();
191 org.apache.xmlbeans.samples.validation.todolist.ItemType target = null;
192 target = (org.apache.xmlbeans.samples.validation.todolist.ItemType)get_store().add_element_user(ITEM$0);
193 return target;
194 }
195 }
196
197 /**
198 * Removes the ith "item" element
199 */
200 public void removeItem(int i)
201 {
202 synchronized (monitor())
203 {
204 check_orphaned();
205 get_store().remove_element(ITEM$0, i);
206 }
207 }
208 }
209 }