001: /*
002: * XML Type: employeeType
003: * Namespace: http://xmlbeans.apache.org/samples/xquery/employees
004: * Java type: org.apache.xmlbeans.samples.xquery.employees.EmployeeType
005: *
006: * Automatically generated - do not modify.
007: */
008: package org.apache.xmlbeans.samples.xquery.employees.impl;
009:
010: /**
011: * An XML employeeType(@http://xmlbeans.apache.org/samples/xquery/employees).
012: *
013: * This is a complex type.
014: */
015: public class EmployeeTypeImpl extends
016: org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements
017: org.apache.xmlbeans.samples.xquery.employees.EmployeeType {
018:
019: public EmployeeTypeImpl(org.apache.xmlbeans.SchemaType sType) {
020: super (sType);
021: }
022:
023: private static final javax.xml.namespace.QName NAME$0 = new javax.xml.namespace.QName(
024: "http://xmlbeans.apache.org/samples/xquery/employees",
025: "name");
026: private static final javax.xml.namespace.QName ADDRESS$2 = new javax.xml.namespace.QName(
027: "http://xmlbeans.apache.org/samples/xquery/employees",
028: "address");
029: private static final javax.xml.namespace.QName PHONE$4 = new javax.xml.namespace.QName(
030: "http://xmlbeans.apache.org/samples/xquery/employees",
031: "phone");
032:
033: /**
034: * Gets the "name" element
035: */
036: public java.lang.String getName() {
037: synchronized (monitor()) {
038: check_orphaned();
039: org.apache.xmlbeans.SimpleValue target = null;
040: target = (org.apache.xmlbeans.SimpleValue) get_store()
041: .find_element_user(NAME$0, 0);
042: if (target == null) {
043: return null;
044: }
045: return target.getStringValue();
046: }
047: }
048:
049: /**
050: * Gets (as xml) the "name" element
051: */
052: public org.apache.xmlbeans.XmlString xgetName() {
053: synchronized (monitor()) {
054: check_orphaned();
055: org.apache.xmlbeans.XmlString target = null;
056: target = (org.apache.xmlbeans.XmlString) get_store()
057: .find_element_user(NAME$0, 0);
058: return target;
059: }
060: }
061:
062: /**
063: * Sets the "name" element
064: */
065: public void setName(java.lang.String name) {
066: synchronized (monitor()) {
067: check_orphaned();
068: org.apache.xmlbeans.SimpleValue target = null;
069: target = (org.apache.xmlbeans.SimpleValue) get_store()
070: .find_element_user(NAME$0, 0);
071: if (target == null) {
072: target = (org.apache.xmlbeans.SimpleValue) get_store()
073: .add_element_user(NAME$0);
074: }
075: target.setStringValue(name);
076: }
077: }
078:
079: /**
080: * Sets (as xml) the "name" element
081: */
082: public void xsetName(org.apache.xmlbeans.XmlString name) {
083: synchronized (monitor()) {
084: check_orphaned();
085: org.apache.xmlbeans.XmlString target = null;
086: target = (org.apache.xmlbeans.XmlString) get_store()
087: .find_element_user(NAME$0, 0);
088: if (target == null) {
089: target = (org.apache.xmlbeans.XmlString) get_store()
090: .add_element_user(NAME$0);
091: }
092: target.set(name);
093: }
094: }
095:
096: /**
097: * Gets array of all "address" elements
098: */
099: public org.apache.xmlbeans.samples.xquery.employees.AddressType[] getAddressArray() {
100: synchronized (monitor()) {
101: check_orphaned();
102: java.util.List targetList = new java.util.ArrayList();
103: get_store().find_all_element_users(ADDRESS$2, targetList);
104: org.apache.xmlbeans.samples.xquery.employees.AddressType[] result = new org.apache.xmlbeans.samples.xquery.employees.AddressType[targetList
105: .size()];
106: targetList.toArray(result);
107: return result;
108: }
109: }
110:
111: /**
112: * Gets ith "address" element
113: */
114: public org.apache.xmlbeans.samples.xquery.employees.AddressType getAddressArray(
115: int i) {
116: synchronized (monitor()) {
117: check_orphaned();
118: org.apache.xmlbeans.samples.xquery.employees.AddressType target = null;
119: target = (org.apache.xmlbeans.samples.xquery.employees.AddressType) get_store()
120: .find_element_user(ADDRESS$2, i);
121: if (target == null) {
122: throw new IndexOutOfBoundsException();
123: }
124: return target;
125: }
126: }
127:
128: /**
129: * Returns number of "address" element
130: */
131: public int sizeOfAddressArray() {
132: synchronized (monitor()) {
133: check_orphaned();
134: return get_store().count_elements(ADDRESS$2);
135: }
136: }
137:
138: /**
139: * Sets array of all "address" element
140: */
141: public void setAddressArray(
142: org.apache.xmlbeans.samples.xquery.employees.AddressType[] addressArray) {
143: synchronized (monitor()) {
144: check_orphaned();
145: arraySetterHelper(addressArray, ADDRESS$2);
146: }
147: }
148:
149: /**
150: * Sets ith "address" element
151: */
152: public void setAddressArray(
153: int i,
154: org.apache.xmlbeans.samples.xquery.employees.AddressType address) {
155: synchronized (monitor()) {
156: check_orphaned();
157: org.apache.xmlbeans.samples.xquery.employees.AddressType target = null;
158: target = (org.apache.xmlbeans.samples.xquery.employees.AddressType) get_store()
159: .find_element_user(ADDRESS$2, i);
160: if (target == null) {
161: throw new IndexOutOfBoundsException();
162: }
163: target.set(address);
164: }
165: }
166:
167: /**
168: * Inserts and returns a new empty value (as xml) as the ith "address" element
169: */
170: public org.apache.xmlbeans.samples.xquery.employees.AddressType insertNewAddress(
171: int i) {
172: synchronized (monitor()) {
173: check_orphaned();
174: org.apache.xmlbeans.samples.xquery.employees.AddressType target = null;
175: target = (org.apache.xmlbeans.samples.xquery.employees.AddressType) get_store()
176: .insert_element_user(ADDRESS$2, i);
177: return target;
178: }
179: }
180:
181: /**
182: * Appends and returns a new empty value (as xml) as the last "address" element
183: */
184: public org.apache.xmlbeans.samples.xquery.employees.AddressType addNewAddress() {
185: synchronized (monitor()) {
186: check_orphaned();
187: org.apache.xmlbeans.samples.xquery.employees.AddressType target = null;
188: target = (org.apache.xmlbeans.samples.xquery.employees.AddressType) get_store()
189: .add_element_user(ADDRESS$2);
190: return target;
191: }
192: }
193:
194: /**
195: * Removes the ith "address" element
196: */
197: public void removeAddress(int i) {
198: synchronized (monitor()) {
199: check_orphaned();
200: get_store().remove_element(ADDRESS$2, i);
201: }
202: }
203:
204: /**
205: * Gets array of all "phone" elements
206: */
207: public org.apache.xmlbeans.samples.xquery.employees.PhoneType[] getPhoneArray() {
208: synchronized (monitor()) {
209: check_orphaned();
210: java.util.List targetList = new java.util.ArrayList();
211: get_store().find_all_element_users(PHONE$4, targetList);
212: org.apache.xmlbeans.samples.xquery.employees.PhoneType[] result = new org.apache.xmlbeans.samples.xquery.employees.PhoneType[targetList
213: .size()];
214: targetList.toArray(result);
215: return result;
216: }
217: }
218:
219: /**
220: * Gets ith "phone" element
221: */
222: public org.apache.xmlbeans.samples.xquery.employees.PhoneType getPhoneArray(
223: int i) {
224: synchronized (monitor()) {
225: check_orphaned();
226: org.apache.xmlbeans.samples.xquery.employees.PhoneType target = null;
227: target = (org.apache.xmlbeans.samples.xquery.employees.PhoneType) get_store()
228: .find_element_user(PHONE$4, i);
229: if (target == null) {
230: throw new IndexOutOfBoundsException();
231: }
232: return target;
233: }
234: }
235:
236: /**
237: * Returns number of "phone" element
238: */
239: public int sizeOfPhoneArray() {
240: synchronized (monitor()) {
241: check_orphaned();
242: return get_store().count_elements(PHONE$4);
243: }
244: }
245:
246: /**
247: * Sets array of all "phone" element
248: */
249: public void setPhoneArray(
250: org.apache.xmlbeans.samples.xquery.employees.PhoneType[] phoneArray) {
251: synchronized (monitor()) {
252: check_orphaned();
253: arraySetterHelper(phoneArray, PHONE$4);
254: }
255: }
256:
257: /**
258: * Sets ith "phone" element
259: */
260: public void setPhoneArray(int i,
261: org.apache.xmlbeans.samples.xquery.employees.PhoneType phone) {
262: synchronized (monitor()) {
263: check_orphaned();
264: org.apache.xmlbeans.samples.xquery.employees.PhoneType target = null;
265: target = (org.apache.xmlbeans.samples.xquery.employees.PhoneType) get_store()
266: .find_element_user(PHONE$4, i);
267: if (target == null) {
268: throw new IndexOutOfBoundsException();
269: }
270: target.set(phone);
271: }
272: }
273:
274: /**
275: * Inserts and returns a new empty value (as xml) as the ith "phone" element
276: */
277: public org.apache.xmlbeans.samples.xquery.employees.PhoneType insertNewPhone(
278: int i) {
279: synchronized (monitor()) {
280: check_orphaned();
281: org.apache.xmlbeans.samples.xquery.employees.PhoneType target = null;
282: target = (org.apache.xmlbeans.samples.xquery.employees.PhoneType) get_store()
283: .insert_element_user(PHONE$4, i);
284: return target;
285: }
286: }
287:
288: /**
289: * Appends and returns a new empty value (as xml) as the last "phone" element
290: */
291: public org.apache.xmlbeans.samples.xquery.employees.PhoneType addNewPhone() {
292: synchronized (monitor()) {
293: check_orphaned();
294: org.apache.xmlbeans.samples.xquery.employees.PhoneType target = null;
295: target = (org.apache.xmlbeans.samples.xquery.employees.PhoneType) get_store()
296: .add_element_user(PHONE$4);
297: return target;
298: }
299: }
300:
301: /**
302: * Removes the ith "phone" element
303: */
304: public void removePhone(int i) {
305: synchronized (monitor()) {
306: check_orphaned();
307: get_store().remove_element(PHONE$4, i);
308: }
309: }
310: }
|