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