1 /*
2 * XML Type: ListOfStrings
3 * Namespace: http://xmlbeans.apache.org/samples/any
4 * Java type: org.apache.xmlbeans.samples.any.ListOfStrings
5 *
6 * Automatically generated - do not modify.
7 */
8 package org.apache.xmlbeans.samples.any.impl;
9 /**
10 * An XML ListOfStrings(@http://xmlbeans.apache.org/samples/any).
11 *
12 * This is a complex type.
13 */
14 public class ListOfStringsImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.apache.xmlbeans.samples.any.ListOfStrings
15 {
16
17 public ListOfStringsImpl(org.apache.xmlbeans.SchemaType sType)
18 {
19 super(sType);
20 }
21
22 private static final javax.xml.namespace.QName STRINGELEMENT$0 =
23 new javax.xml.namespace.QName("http://xmlbeans.apache.org/samples/any", "stringelement");
24 private static final javax.xml.namespace.QName ID$2 =
25 new javax.xml.namespace.QName("", "id");
26
27
28 /**
29 * Gets array of all "stringelement" elements
30 */
31 public java.lang.String[] getStringelementArray()
32 {
33 synchronized (monitor())
34 {
35 check_orphaned();
36 java.util.List targetList = new java.util.ArrayList();
37 get_store().find_all_element_users(STRINGELEMENT$0, targetList);
38 java.lang.String[] result = new java.lang.String[targetList.size()];
39 for (int i = 0, len = targetList.size() ; i < len ; i++)
40 result[i] = ((org.apache.xmlbeans.SimpleValue)targetList.get(i)).getStringValue();
41 return result;
42 }
43 }
44
45 /**
46 * Gets ith "stringelement" element
47 */
48 public java.lang.String getStringelementArray(int i)
49 {
50 synchronized (monitor())
51 {
52 check_orphaned();
53 org.apache.xmlbeans.SimpleValue target = null;
54 target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(STRINGELEMENT$0, i);
55 if (target == null)
56 {
57 throw new IndexOutOfBoundsException();
58 }
59 return target.getStringValue();
60 }
61 }
62
63 /**
64 * Gets (as xml) array of all "stringelement" elements
65 */
66 public org.apache.xmlbeans.XmlString[] xgetStringelementArray()
67 {
68 synchronized (monitor())
69 {
70 check_orphaned();
71 java.util.List targetList = new java.util.ArrayList();
72 get_store().find_all_element_users(STRINGELEMENT$0, targetList);
73 org.apache.xmlbeans.XmlString[] result = new org.apache.xmlbeans.XmlString[targetList.size()];
74 targetList.toArray(result);
75 return result;
76 }
77 }
78
79 /**
80 * Gets (as xml) ith "stringelement" element
81 */
82 public org.apache.xmlbeans.XmlString xgetStringelementArray(int i)
83 {
84 synchronized (monitor())
85 {
86 check_orphaned();
87 org.apache.xmlbeans.XmlString target = null;
88 target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(STRINGELEMENT$0, i);
89 if (target == null)
90 {
91 throw new IndexOutOfBoundsException();
92 }
93 return (org.apache.xmlbeans.XmlString)target;
94 }
95 }
96
97 /**
98 * Returns number of "stringelement" element
99 */
100 public int sizeOfStringelementArray()
101 {
102 synchronized (monitor())
103 {
104 check_orphaned();
105 return get_store().count_elements(STRINGELEMENT$0);
106 }
107 }
108
109 /**
110 * Sets array of all "stringelement" element
111 */
112 public void setStringelementArray(java.lang.String[] stringelementArray)
113 {
114 synchronized (monitor())
115 {
116 check_orphaned();
117 arraySetterHelper(stringelementArray, STRINGELEMENT$0);
118 }
119 }
120
121 /**
122 * Sets ith "stringelement" element
123 */
124 public void setStringelementArray(int i, java.lang.String stringelement)
125 {
126 synchronized (monitor())
127 {
128 check_orphaned();
129 org.apache.xmlbeans.SimpleValue target = null;
130 target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(STRINGELEMENT$0, i);
131 if (target == null)
132 {
133 throw new IndexOutOfBoundsException();
134 }
135 target.setStringValue(stringelement);
136 }
137 }
138
139 /**
140 * Sets (as xml) array of all "stringelement" element
141 */
142 public void xsetStringelementArray(org.apache.xmlbeans.XmlString[]stringelementArray)
143 {
144 synchronized (monitor())
145 {
146 check_orphaned();
147 arraySetterHelper(stringelementArray, STRINGELEMENT$0);
148 }
149 }
150
151 /**
152 * Sets (as xml) ith "stringelement" element
153 */
154 public void xsetStringelementArray(int i, org.apache.xmlbeans.XmlString stringelement)
155 {
156 synchronized (monitor())
157 {
158 check_orphaned();
159 org.apache.xmlbeans.XmlString target = null;
160 target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(STRINGELEMENT$0, i);
161 if (target == null)
162 {
163 throw new IndexOutOfBoundsException();
164 }
165 target.set(stringelement);
166 }
167 }
168
169 /**
170 * Inserts the value as the ith "stringelement" element
171 */
172 public void insertStringelement(int i, java.lang.String stringelement)
173 {
174 synchronized (monitor())
175 {
176 check_orphaned();
177 org.apache.xmlbeans.SimpleValue target =
178 (org.apache.xmlbeans.SimpleValue)get_store().insert_element_user(STRINGELEMENT$0, i);
179 target.setStringValue(stringelement);
180 }
181 }
182
183 /**
184 * Appends the value as the last "stringelement" element
185 */
186 public void addStringelement(java.lang.String stringelement)
187 {
188 synchronized (monitor())
189 {
190 check_orphaned();
191 org.apache.xmlbeans.SimpleValue target = null;
192 target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(STRINGELEMENT$0);
193 target.setStringValue(stringelement);
194 }
195 }
196
197 /**
198 * Inserts and returns a new empty value (as xml) as the ith "stringelement" element
199 */
200 public org.apache.xmlbeans.XmlString insertNewStringelement(int i)
201 {
202 synchronized (monitor())
203 {
204 check_orphaned();
205 org.apache.xmlbeans.XmlString target = null;
206 target = (org.apache.xmlbeans.XmlString)get_store().insert_element_user(STRINGELEMENT$0, i);
207 return target;
208 }
209 }
210
211 /**
212 * Appends and returns a new empty value (as xml) as the last "stringelement" element
213 */
214 public org.apache.xmlbeans.XmlString addNewStringelement()
215 {
216 synchronized (monitor())
217 {
218 check_orphaned();
219 org.apache.xmlbeans.XmlString target = null;
220 target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(STRINGELEMENT$0);
221 return target;
222 }
223 }
224
225 /**
226 * Removes the ith "stringelement" element
227 */
228 public void removeStringelement(int i)
229 {
230 synchronized (monitor())
231 {
232 check_orphaned();
233 get_store().remove_element(STRINGELEMENT$0, i);
234 }
235 }
236
237 /**
238 * Gets the "id" attribute
239 */
240 public java.lang.String getId()
241 {
242 synchronized (monitor())
243 {
244 check_orphaned();
245 org.apache.xmlbeans.SimpleValue target = null;
246 target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ID$2);
247 if (target == null)
248 {
249 return null;
250 }
251 return target.getStringValue();
252 }
253 }
254
255 /**
256 * Gets (as xml) the "id" attribute
257 */
258 public org.apache.xmlbeans.XmlString xgetId()
259 {
260 synchronized (monitor())
261 {
262 check_orphaned();
263 org.apache.xmlbeans.XmlString target = null;
264 target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(ID$2);
265 return target;
266 }
267 }
268
269 /**
270 * True if has "id" attribute
271 */
272 public boolean isSetId()
273 {
274 synchronized (monitor())
275 {
276 check_orphaned();
277 return get_store().find_attribute_user(ID$2) != null;
278 }
279 }
280
281 /**
282 * Sets the "id" attribute
283 */
284 public void setId(java.lang.String id)
285 {
286 synchronized (monitor())
287 {
288 check_orphaned();
289 org.apache.xmlbeans.SimpleValue target = null;
290 target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ID$2);
291 if (target == null)
292 {
293 target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(ID$2);
294 }
295 target.setStringValue(id);
296 }
297 }
298
299 /**
300 * Sets (as xml) the "id" attribute
301 */
302 public void xsetId(org.apache.xmlbeans.XmlString id)
303 {
304 synchronized (monitor())
305 {
306 check_orphaned();
307 org.apache.xmlbeans.XmlString target = null;
308 target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(ID$2);
309 if (target == null)
310 {
311 target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(ID$2);
312 }
313 target.set(id);
314 }
315 }
316
317 /**
318 * Unsets the "id" attribute
319 */
320 public void unsetId()
321 {
322 synchronized (monitor())
323 {
324 check_orphaned();
325 get_store().remove_attribute(ID$2);
326 }
327 }
328 }