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