001: /*
002: * An XML document type.
003: * Localname: employees
004: * Namespace: http://xmlbeans.apache.org/samples/xquery/employees
005: * Java type: org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument
006: *
007: * Automatically generated - do not modify.
008: */
009: package org.apache.xmlbeans.samples.xquery.employees.impl;
010:
011: /**
012: * A document containing one employees(@http://xmlbeans.apache.org/samples/xquery/employees) element.
013: *
014: * This is a complex type.
015: */
016: public class EmployeesDocumentImpl extends
017: org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements
018: org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument {
019:
020: public EmployeesDocumentImpl(org.apache.xmlbeans.SchemaType sType) {
021: super (sType);
022: }
023:
024: private static final javax.xml.namespace.QName EMPLOYEES$0 = new javax.xml.namespace.QName(
025: "http://xmlbeans.apache.org/samples/xquery/employees",
026: "employees");
027:
028: /**
029: * Gets the "employees" element
030: */
031: public org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees getEmployees() {
032: synchronized (monitor()) {
033: check_orphaned();
034: org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees target = null;
035: target = (org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees) get_store()
036: .find_element_user(EMPLOYEES$0, 0);
037: if (target == null) {
038: return null;
039: }
040: return target;
041: }
042: }
043:
044: /**
045: * Sets the "employees" element
046: */
047: public void setEmployees(
048: org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees employees) {
049: synchronized (monitor()) {
050: check_orphaned();
051: org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees target = null;
052: target = (org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees) get_store()
053: .find_element_user(EMPLOYEES$0, 0);
054: if (target == null) {
055: target = (org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees) get_store()
056: .add_element_user(EMPLOYEES$0);
057: }
058: target.set(employees);
059: }
060: }
061:
062: /**
063: * Appends and returns a new empty "employees" element
064: */
065: public org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees addNewEmployees() {
066: synchronized (monitor()) {
067: check_orphaned();
068: org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees target = null;
069: target = (org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees) get_store()
070: .add_element_user(EMPLOYEES$0);
071: return target;
072: }
073: }
074:
075: /**
076: * An XML employees(@http://xmlbeans.apache.org/samples/xquery/employees).
077: *
078: * This is a complex type.
079: */
080: public static class EmployeesImpl extends
081: org.apache.xmlbeans.impl.values.XmlComplexContentImpl
082: implements
083: org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees {
084:
085: public EmployeesImpl(org.apache.xmlbeans.SchemaType sType) {
086: super (sType);
087: }
088:
089: private static final javax.xml.namespace.QName EMPLOYEE$0 = new javax.xml.namespace.QName(
090: "http://xmlbeans.apache.org/samples/xquery/employees",
091: "employee");
092:
093: /**
094: * Gets array of all "employee" elements
095: */
096: public org.apache.xmlbeans.samples.xquery.employees.EmployeeType[] getEmployeeArray() {
097: synchronized (monitor()) {
098: check_orphaned();
099: java.util.List targetList = new java.util.ArrayList();
100: get_store().find_all_element_users(EMPLOYEE$0,
101: targetList);
102: org.apache.xmlbeans.samples.xquery.employees.EmployeeType[] result = new org.apache.xmlbeans.samples.xquery.employees.EmployeeType[targetList
103: .size()];
104: targetList.toArray(result);
105: return result;
106: }
107: }
108:
109: /**
110: * Gets ith "employee" element
111: */
112: public org.apache.xmlbeans.samples.xquery.employees.EmployeeType getEmployeeArray(
113: int i) {
114: synchronized (monitor()) {
115: check_orphaned();
116: org.apache.xmlbeans.samples.xquery.employees.EmployeeType target = null;
117: target = (org.apache.xmlbeans.samples.xquery.employees.EmployeeType) get_store()
118: .find_element_user(EMPLOYEE$0, i);
119: if (target == null) {
120: throw new IndexOutOfBoundsException();
121: }
122: return target;
123: }
124: }
125:
126: /**
127: * Returns number of "employee" element
128: */
129: public int sizeOfEmployeeArray() {
130: synchronized (monitor()) {
131: check_orphaned();
132: return get_store().count_elements(EMPLOYEE$0);
133: }
134: }
135:
136: /**
137: * Sets array of all "employee" element
138: */
139: public void setEmployeeArray(
140: org.apache.xmlbeans.samples.xquery.employees.EmployeeType[] employeeArray) {
141: synchronized (monitor()) {
142: check_orphaned();
143: arraySetterHelper(employeeArray, EMPLOYEE$0);
144: }
145: }
146:
147: /**
148: * Sets ith "employee" element
149: */
150: public void setEmployeeArray(
151: int i,
152: org.apache.xmlbeans.samples.xquery.employees.EmployeeType employee) {
153: synchronized (monitor()) {
154: check_orphaned();
155: org.apache.xmlbeans.samples.xquery.employees.EmployeeType target = null;
156: target = (org.apache.xmlbeans.samples.xquery.employees.EmployeeType) get_store()
157: .find_element_user(EMPLOYEE$0, i);
158: if (target == null) {
159: throw new IndexOutOfBoundsException();
160: }
161: target.set(employee);
162: }
163: }
164:
165: /**
166: * Inserts and returns a new empty value (as xml) as the ith "employee" element
167: */
168: public org.apache.xmlbeans.samples.xquery.employees.EmployeeType insertNewEmployee(
169: int i) {
170: synchronized (monitor()) {
171: check_orphaned();
172: org.apache.xmlbeans.samples.xquery.employees.EmployeeType target = null;
173: target = (org.apache.xmlbeans.samples.xquery.employees.EmployeeType) get_store()
174: .insert_element_user(EMPLOYEE$0, i);
175: return target;
176: }
177: }
178:
179: /**
180: * Appends and returns a new empty value (as xml) as the last "employee" element
181: */
182: public org.apache.xmlbeans.samples.xquery.employees.EmployeeType addNewEmployee() {
183: synchronized (monitor()) {
184: check_orphaned();
185: org.apache.xmlbeans.samples.xquery.employees.EmployeeType target = null;
186: target = (org.apache.xmlbeans.samples.xquery.employees.EmployeeType) get_store()
187: .add_element_user(EMPLOYEE$0);
188: return target;
189: }
190: }
191:
192: /**
193: * Removes the ith "employee" element
194: */
195: public void removeEmployee(int i) {
196: synchronized (monitor()) {
197: check_orphaned();
198: get_store().remove_element(EMPLOYEE$0, i);
199: }
200: }
201: }
202: }
|