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