001    /*
002     * XML Type:  roleType
003     * Namespace: http://geronimo.apache.org/xml/ns/security-1.2
004     * Java type: org.apache.geronimo.xml.ns.security12.RoleType
005     *
006     * Automatically generated - do not modify.
007     */
008    package org.apache.geronimo.xml.ns.security12.impl;
009    /**
010     * An XML roleType(@http://geronimo.apache.org/xml/ns/security-1.2).
011     *
012     * This is a complex type.
013     */
014    public class RoleTypeImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.apache.geronimo.xml.ns.security12.RoleType
015    {
016        
017        public RoleTypeImpl(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 REALMPRINCIPAL$2 = 
025            new javax.xml.namespace.QName("http://geronimo.apache.org/xml/ns/security-1.2", "realm-principal");
026        private static final javax.xml.namespace.QName LOGINDOMAINPRINCIPAL$4 = 
027            new javax.xml.namespace.QName("http://geronimo.apache.org/xml/ns/security-1.2", "login-domain-principal");
028        private static final javax.xml.namespace.QName PRINCIPAL$6 = 
029            new javax.xml.namespace.QName("http://geronimo.apache.org/xml/ns/security-1.2", "principal");
030        private static final javax.xml.namespace.QName DISTINGUISHEDNAME$8 = 
031            new javax.xml.namespace.QName("http://geronimo.apache.org/xml/ns/security-1.2", "distinguished-name");
032        private static final javax.xml.namespace.QName ROLENAME$10 = 
033            new javax.xml.namespace.QName("", "role-name");
034        
035        
036        /**
037         * Gets array of all "description" elements
038         */
039        public org.apache.geronimo.xml.ns.security12.DescriptionType[] getDescriptionArray()
040        {
041            synchronized (monitor())
042            {
043                check_orphaned();
044                java.util.List targetList = new java.util.ArrayList();
045                get_store().find_all_element_users(DESCRIPTION$0, targetList);
046                org.apache.geronimo.xml.ns.security12.DescriptionType[] result = new org.apache.geronimo.xml.ns.security12.DescriptionType[targetList.size()];
047                targetList.toArray(result);
048                return result;
049            }
050        }
051        
052        /**
053         * Gets ith "description" element
054         */
055        public org.apache.geronimo.xml.ns.security12.DescriptionType getDescriptionArray(int i)
056        {
057            synchronized (monitor())
058            {
059                check_orphaned();
060                org.apache.geronimo.xml.ns.security12.DescriptionType target = null;
061                target = (org.apache.geronimo.xml.ns.security12.DescriptionType)get_store().find_element_user(DESCRIPTION$0, i);
062                if (target == null)
063                {
064                    throw new IndexOutOfBoundsException();
065                }
066                return target;
067            }
068        }
069        
070        /**
071         * Returns number of "description" element
072         */
073        public int sizeOfDescriptionArray()
074        {
075            synchronized (monitor())
076            {
077                check_orphaned();
078                return get_store().count_elements(DESCRIPTION$0);
079            }
080        }
081        
082        /**
083         * Sets array of all "description" element
084         */
085        public void setDescriptionArray(org.apache.geronimo.xml.ns.security12.DescriptionType[] descriptionArray)
086        {
087            synchronized (monitor())
088            {
089                check_orphaned();
090                arraySetterHelper(descriptionArray, DESCRIPTION$0);
091            }
092        }
093        
094        /**
095         * Sets ith "description" element
096         */
097        public void setDescriptionArray(int i, org.apache.geronimo.xml.ns.security12.DescriptionType description)
098        {
099            synchronized (monitor())
100            {
101                check_orphaned();
102                org.apache.geronimo.xml.ns.security12.DescriptionType target = null;
103                target = (org.apache.geronimo.xml.ns.security12.DescriptionType)get_store().find_element_user(DESCRIPTION$0, i);
104                if (target == null)
105                {
106                    throw new IndexOutOfBoundsException();
107                }
108                target.set(description);
109            }
110        }
111        
112        /**
113         * Inserts and returns a new empty value (as xml) as the ith "description" element
114         */
115        public org.apache.geronimo.xml.ns.security12.DescriptionType insertNewDescription(int i)
116        {
117            synchronized (monitor())
118            {
119                check_orphaned();
120                org.apache.geronimo.xml.ns.security12.DescriptionType target = null;
121                target = (org.apache.geronimo.xml.ns.security12.DescriptionType)get_store().insert_element_user(DESCRIPTION$0, i);
122                return target;
123            }
124        }
125        
126        /**
127         * Appends and returns a new empty value (as xml) as the last "description" element
128         */
129        public org.apache.geronimo.xml.ns.security12.DescriptionType addNewDescription()
130        {
131            synchronized (monitor())
132            {
133                check_orphaned();
134                org.apache.geronimo.xml.ns.security12.DescriptionType target = null;
135                target = (org.apache.geronimo.xml.ns.security12.DescriptionType)get_store().add_element_user(DESCRIPTION$0);
136                return target;
137            }
138        }
139        
140        /**
141         * Removes the ith "description" element
142         */
143        public void removeDescription(int i)
144        {
145            synchronized (monitor())
146            {
147                check_orphaned();
148                get_store().remove_element(DESCRIPTION$0, i);
149            }
150        }
151        
152        /**
153         * Gets array of all "realm-principal" elements
154         */
155        public org.apache.geronimo.xml.ns.security12.RealmPrincipalType[] getRealmPrincipalArray()
156        {
157            synchronized (monitor())
158            {
159                check_orphaned();
160                java.util.List targetList = new java.util.ArrayList();
161                get_store().find_all_element_users(REALMPRINCIPAL$2, targetList);
162                org.apache.geronimo.xml.ns.security12.RealmPrincipalType[] result = new org.apache.geronimo.xml.ns.security12.RealmPrincipalType[targetList.size()];
163                targetList.toArray(result);
164                return result;
165            }
166        }
167        
168        /**
169         * Gets ith "realm-principal" element
170         */
171        public org.apache.geronimo.xml.ns.security12.RealmPrincipalType getRealmPrincipalArray(int i)
172        {
173            synchronized (monitor())
174            {
175                check_orphaned();
176                org.apache.geronimo.xml.ns.security12.RealmPrincipalType target = null;
177                target = (org.apache.geronimo.xml.ns.security12.RealmPrincipalType)get_store().find_element_user(REALMPRINCIPAL$2, i);
178                if (target == null)
179                {
180                    throw new IndexOutOfBoundsException();
181                }
182                return target;
183            }
184        }
185        
186        /**
187         * Returns number of "realm-principal" element
188         */
189        public int sizeOfRealmPrincipalArray()
190        {
191            synchronized (monitor())
192            {
193                check_orphaned();
194                return get_store().count_elements(REALMPRINCIPAL$2);
195            }
196        }
197        
198        /**
199         * Sets array of all "realm-principal" element
200         */
201        public void setRealmPrincipalArray(org.apache.geronimo.xml.ns.security12.RealmPrincipalType[] realmPrincipalArray)
202        {
203            synchronized (monitor())
204            {
205                check_orphaned();
206                arraySetterHelper(realmPrincipalArray, REALMPRINCIPAL$2);
207            }
208        }
209        
210        /**
211         * Sets ith "realm-principal" element
212         */
213        public void setRealmPrincipalArray(int i, org.apache.geronimo.xml.ns.security12.RealmPrincipalType realmPrincipal)
214        {
215            synchronized (monitor())
216            {
217                check_orphaned();
218                org.apache.geronimo.xml.ns.security12.RealmPrincipalType target = null;
219                target = (org.apache.geronimo.xml.ns.security12.RealmPrincipalType)get_store().find_element_user(REALMPRINCIPAL$2, i);
220                if (target == null)
221                {
222                    throw new IndexOutOfBoundsException();
223                }
224                target.set(realmPrincipal);
225            }
226        }
227        
228        /**
229         * Inserts and returns a new empty value (as xml) as the ith "realm-principal" element
230         */
231        public org.apache.geronimo.xml.ns.security12.RealmPrincipalType insertNewRealmPrincipal(int i)
232        {
233            synchronized (monitor())
234            {
235                check_orphaned();
236                org.apache.geronimo.xml.ns.security12.RealmPrincipalType target = null;
237                target = (org.apache.geronimo.xml.ns.security12.RealmPrincipalType)get_store().insert_element_user(REALMPRINCIPAL$2, i);
238                return target;
239            }
240        }
241        
242        /**
243         * Appends and returns a new empty value (as xml) as the last "realm-principal" element
244         */
245        public org.apache.geronimo.xml.ns.security12.RealmPrincipalType addNewRealmPrincipal()
246        {
247            synchronized (monitor())
248            {
249                check_orphaned();
250                org.apache.geronimo.xml.ns.security12.RealmPrincipalType target = null;
251                target = (org.apache.geronimo.xml.ns.security12.RealmPrincipalType)get_store().add_element_user(REALMPRINCIPAL$2);
252                return target;
253            }
254        }
255        
256        /**
257         * Removes the ith "realm-principal" element
258         */
259        public void removeRealmPrincipal(int i)
260        {
261            synchronized (monitor())
262            {
263                check_orphaned();
264                get_store().remove_element(REALMPRINCIPAL$2, i);
265            }
266        }
267        
268        /**
269         * Gets array of all "login-domain-principal" elements
270         */
271        public org.apache.geronimo.xml.ns.security12.LoginDomainPrincipalType[] getLoginDomainPrincipalArray()
272        {
273            synchronized (monitor())
274            {
275                check_orphaned();
276                java.util.List targetList = new java.util.ArrayList();
277                get_store().find_all_element_users(LOGINDOMAINPRINCIPAL$4, targetList);
278                org.apache.geronimo.xml.ns.security12.LoginDomainPrincipalType[] result = new org.apache.geronimo.xml.ns.security12.LoginDomainPrincipalType[targetList.size()];
279                targetList.toArray(result);
280                return result;
281            }
282        }
283        
284        /**
285         * Gets ith "login-domain-principal" element
286         */
287        public org.apache.geronimo.xml.ns.security12.LoginDomainPrincipalType getLoginDomainPrincipalArray(int i)
288        {
289            synchronized (monitor())
290            {
291                check_orphaned();
292                org.apache.geronimo.xml.ns.security12.LoginDomainPrincipalType target = null;
293                target = (org.apache.geronimo.xml.ns.security12.LoginDomainPrincipalType)get_store().find_element_user(LOGINDOMAINPRINCIPAL$4, i);
294                if (target == null)
295                {
296                    throw new IndexOutOfBoundsException();
297                }
298                return target;
299            }
300        }
301        
302        /**
303         * Returns number of "login-domain-principal" element
304         */
305        public int sizeOfLoginDomainPrincipalArray()
306        {
307            synchronized (monitor())
308            {
309                check_orphaned();
310                return get_store().count_elements(LOGINDOMAINPRINCIPAL$4);
311            }
312        }
313        
314        /**
315         * Sets array of all "login-domain-principal" element
316         */
317        public void setLoginDomainPrincipalArray(org.apache.geronimo.xml.ns.security12.LoginDomainPrincipalType[] loginDomainPrincipalArray)
318        {
319            synchronized (monitor())
320            {
321                check_orphaned();
322                arraySetterHelper(loginDomainPrincipalArray, LOGINDOMAINPRINCIPAL$4);
323            }
324        }
325        
326        /**
327         * Sets ith "login-domain-principal" element
328         */
329        public void setLoginDomainPrincipalArray(int i, org.apache.geronimo.xml.ns.security12.LoginDomainPrincipalType loginDomainPrincipal)
330        {
331            synchronized (monitor())
332            {
333                check_orphaned();
334                org.apache.geronimo.xml.ns.security12.LoginDomainPrincipalType target = null;
335                target = (org.apache.geronimo.xml.ns.security12.LoginDomainPrincipalType)get_store().find_element_user(LOGINDOMAINPRINCIPAL$4, i);
336                if (target == null)
337                {
338                    throw new IndexOutOfBoundsException();
339                }
340                target.set(loginDomainPrincipal);
341            }
342        }
343        
344        /**
345         * Inserts and returns a new empty value (as xml) as the ith "login-domain-principal" element
346         */
347        public org.apache.geronimo.xml.ns.security12.LoginDomainPrincipalType insertNewLoginDomainPrincipal(int i)
348        {
349            synchronized (monitor())
350            {
351                check_orphaned();
352                org.apache.geronimo.xml.ns.security12.LoginDomainPrincipalType target = null;
353                target = (org.apache.geronimo.xml.ns.security12.LoginDomainPrincipalType)get_store().insert_element_user(LOGINDOMAINPRINCIPAL$4, i);
354                return target;
355            }
356        }
357        
358        /**
359         * Appends and returns a new empty value (as xml) as the last "login-domain-principal" element
360         */
361        public org.apache.geronimo.xml.ns.security12.LoginDomainPrincipalType addNewLoginDomainPrincipal()
362        {
363            synchronized (monitor())
364            {
365                check_orphaned();
366                org.apache.geronimo.xml.ns.security12.LoginDomainPrincipalType target = null;
367                target = (org.apache.geronimo.xml.ns.security12.LoginDomainPrincipalType)get_store().add_element_user(LOGINDOMAINPRINCIPAL$4);
368                return target;
369            }
370        }
371        
372        /**
373         * Removes the ith "login-domain-principal" element
374         */
375        public void removeLoginDomainPrincipal(int i)
376        {
377            synchronized (monitor())
378            {
379                check_orphaned();
380                get_store().remove_element(LOGINDOMAINPRINCIPAL$4, i);
381            }
382        }
383        
384        /**
385         * Gets array of all "principal" elements
386         */
387        public org.apache.geronimo.xml.ns.security12.PrincipalType[] getPrincipalArray()
388        {
389            synchronized (monitor())
390            {
391                check_orphaned();
392                java.util.List targetList = new java.util.ArrayList();
393                get_store().find_all_element_users(PRINCIPAL$6, targetList);
394                org.apache.geronimo.xml.ns.security12.PrincipalType[] result = new org.apache.geronimo.xml.ns.security12.PrincipalType[targetList.size()];
395                targetList.toArray(result);
396                return result;
397            }
398        }
399        
400        /**
401         * Gets ith "principal" element
402         */
403        public org.apache.geronimo.xml.ns.security12.PrincipalType getPrincipalArray(int i)
404        {
405            synchronized (monitor())
406            {
407                check_orphaned();
408                org.apache.geronimo.xml.ns.security12.PrincipalType target = null;
409                target = (org.apache.geronimo.xml.ns.security12.PrincipalType)get_store().find_element_user(PRINCIPAL$6, i);
410                if (target == null)
411                {
412                    throw new IndexOutOfBoundsException();
413                }
414                return target;
415            }
416        }
417        
418        /**
419         * Returns number of "principal" element
420         */
421        public int sizeOfPrincipalArray()
422        {
423            synchronized (monitor())
424            {
425                check_orphaned();
426                return get_store().count_elements(PRINCIPAL$6);
427            }
428        }
429        
430        /**
431         * Sets array of all "principal" element
432         */
433        public void setPrincipalArray(org.apache.geronimo.xml.ns.security12.PrincipalType[] principalArray)
434        {
435            synchronized (monitor())
436            {
437                check_orphaned();
438                arraySetterHelper(principalArray, PRINCIPAL$6);
439            }
440        }
441        
442        /**
443         * Sets ith "principal" element
444         */
445        public void setPrincipalArray(int i, org.apache.geronimo.xml.ns.security12.PrincipalType principal)
446        {
447            synchronized (monitor())
448            {
449                check_orphaned();
450                org.apache.geronimo.xml.ns.security12.PrincipalType target = null;
451                target = (org.apache.geronimo.xml.ns.security12.PrincipalType)get_store().find_element_user(PRINCIPAL$6, i);
452                if (target == null)
453                {
454                    throw new IndexOutOfBoundsException();
455                }
456                target.set(principal);
457            }
458        }
459        
460        /**
461         * Inserts and returns a new empty value (as xml) as the ith "principal" element
462         */
463        public org.apache.geronimo.xml.ns.security12.PrincipalType insertNewPrincipal(int i)
464        {
465            synchronized (monitor())
466            {
467                check_orphaned();
468                org.apache.geronimo.xml.ns.security12.PrincipalType target = null;
469                target = (org.apache.geronimo.xml.ns.security12.PrincipalType)get_store().insert_element_user(PRINCIPAL$6, i);
470                return target;
471            }
472        }
473        
474        /**
475         * Appends and returns a new empty value (as xml) as the last "principal" element
476         */
477        public org.apache.geronimo.xml.ns.security12.PrincipalType addNewPrincipal()
478        {
479            synchronized (monitor())
480            {
481                check_orphaned();
482                org.apache.geronimo.xml.ns.security12.PrincipalType target = null;
483                target = (org.apache.geronimo.xml.ns.security12.PrincipalType)get_store().add_element_user(PRINCIPAL$6);
484                return target;
485            }
486        }
487        
488        /**
489         * Removes the ith "principal" element
490         */
491        public void removePrincipal(int i)
492        {
493            synchronized (monitor())
494            {
495                check_orphaned();
496                get_store().remove_element(PRINCIPAL$6, i);
497            }
498        }
499        
500        /**
501         * Gets array of all "distinguished-name" elements
502         */
503        public org.apache.geronimo.xml.ns.security12.DistinguishedNameType[] getDistinguishedNameArray()
504        {
505            synchronized (monitor())
506            {
507                check_orphaned();
508                java.util.List targetList = new java.util.ArrayList();
509                get_store().find_all_element_users(DISTINGUISHEDNAME$8, targetList);
510                org.apache.geronimo.xml.ns.security12.DistinguishedNameType[] result = new org.apache.geronimo.xml.ns.security12.DistinguishedNameType[targetList.size()];
511                targetList.toArray(result);
512                return result;
513            }
514        }
515        
516        /**
517         * Gets ith "distinguished-name" element
518         */
519        public org.apache.geronimo.xml.ns.security12.DistinguishedNameType getDistinguishedNameArray(int i)
520        {
521            synchronized (monitor())
522            {
523                check_orphaned();
524                org.apache.geronimo.xml.ns.security12.DistinguishedNameType target = null;
525                target = (org.apache.geronimo.xml.ns.security12.DistinguishedNameType)get_store().find_element_user(DISTINGUISHEDNAME$8, i);
526                if (target == null)
527                {
528                    throw new IndexOutOfBoundsException();
529                }
530                return target;
531            }
532        }
533        
534        /**
535         * Returns number of "distinguished-name" element
536         */
537        public int sizeOfDistinguishedNameArray()
538        {
539            synchronized (monitor())
540            {
541                check_orphaned();
542                return get_store().count_elements(DISTINGUISHEDNAME$8);
543            }
544        }
545        
546        /**
547         * Sets array of all "distinguished-name" element
548         */
549        public void setDistinguishedNameArray(org.apache.geronimo.xml.ns.security12.DistinguishedNameType[] distinguishedNameArray)
550        {
551            synchronized (monitor())
552            {
553                check_orphaned();
554                arraySetterHelper(distinguishedNameArray, DISTINGUISHEDNAME$8);
555            }
556        }
557        
558        /**
559         * Sets ith "distinguished-name" element
560         */
561        public void setDistinguishedNameArray(int i, org.apache.geronimo.xml.ns.security12.DistinguishedNameType distinguishedName)
562        {
563            synchronized (monitor())
564            {
565                check_orphaned();
566                org.apache.geronimo.xml.ns.security12.DistinguishedNameType target = null;
567                target = (org.apache.geronimo.xml.ns.security12.DistinguishedNameType)get_store().find_element_user(DISTINGUISHEDNAME$8, i);
568                if (target == null)
569                {
570                    throw new IndexOutOfBoundsException();
571                }
572                target.set(distinguishedName);
573            }
574        }
575        
576        /**
577         * Inserts and returns a new empty value (as xml) as the ith "distinguished-name" element
578         */
579        public org.apache.geronimo.xml.ns.security12.DistinguishedNameType insertNewDistinguishedName(int i)
580        {
581            synchronized (monitor())
582            {
583                check_orphaned();
584                org.apache.geronimo.xml.ns.security12.DistinguishedNameType target = null;
585                target = (org.apache.geronimo.xml.ns.security12.DistinguishedNameType)get_store().insert_element_user(DISTINGUISHEDNAME$8, i);
586                return target;
587            }
588        }
589        
590        /**
591         * Appends and returns a new empty value (as xml) as the last "distinguished-name" element
592         */
593        public org.apache.geronimo.xml.ns.security12.DistinguishedNameType addNewDistinguishedName()
594        {
595            synchronized (monitor())
596            {
597                check_orphaned();
598                org.apache.geronimo.xml.ns.security12.DistinguishedNameType target = null;
599                target = (org.apache.geronimo.xml.ns.security12.DistinguishedNameType)get_store().add_element_user(DISTINGUISHEDNAME$8);
600                return target;
601            }
602        }
603        
604        /**
605         * Removes the ith "distinguished-name" element
606         */
607        public void removeDistinguishedName(int i)
608        {
609            synchronized (monitor())
610            {
611                check_orphaned();
612                get_store().remove_element(DISTINGUISHEDNAME$8, i);
613            }
614        }
615        
616        /**
617         * Gets the "role-name" attribute
618         */
619        public java.lang.String getRoleName()
620        {
621            synchronized (monitor())
622            {
623                check_orphaned();
624                org.apache.xmlbeans.SimpleValue target = null;
625                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ROLENAME$10);
626                if (target == null)
627                {
628                    return null;
629                }
630                return target.getStringValue();
631            }
632        }
633        
634        /**
635         * Gets (as xml) the "role-name" attribute
636         */
637        public org.apache.xmlbeans.XmlString xgetRoleName()
638        {
639            synchronized (monitor())
640            {
641                check_orphaned();
642                org.apache.xmlbeans.XmlString target = null;
643                target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(ROLENAME$10);
644                return target;
645            }
646        }
647        
648        /**
649         * Sets the "role-name" attribute
650         */
651        public void setRoleName(java.lang.String roleName)
652        {
653            synchronized (monitor())
654            {
655                check_orphaned();
656                org.apache.xmlbeans.SimpleValue target = null;
657                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ROLENAME$10);
658                if (target == null)
659                {
660                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(ROLENAME$10);
661                }
662                target.setStringValue(roleName);
663            }
664        }
665        
666        /**
667         * Sets (as xml) the "role-name" attribute
668         */
669        public void xsetRoleName(org.apache.xmlbeans.XmlString roleName)
670        {
671            synchronized (monitor())
672            {
673                check_orphaned();
674                org.apache.xmlbeans.XmlString target = null;
675                target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(ROLENAME$10);
676                if (target == null)
677                {
678                    target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(ROLENAME$10);
679                }
680                target.set(roleName);
681            }
682        }
683    }