001    /*
002     * XML Type:  service-completionType
003     * Namespace: http://geronimo.apache.org/xml/ns/naming-1.2
004     * Java type: org.apache.geronimo.xbeans.geronimo.naming.GerServiceCompletionType
005     *
006     * Automatically generated - do not modify.
007     */
008    package org.apache.geronimo.xbeans.geronimo.naming.impl;
009    /**
010     * An XML service-completionType(@http://geronimo.apache.org/xml/ns/naming-1.2).
011     *
012     * This is a complex type.
013     */
014    public class GerServiceCompletionTypeImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.apache.geronimo.xbeans.geronimo.naming.GerServiceCompletionType
015    {
016        
017        public GerServiceCompletionTypeImpl(org.apache.xmlbeans.SchemaType sType)
018        {
019            super(sType);
020        }
021        
022        private static final javax.xml.namespace.QName SERVICENAME$0 = 
023            new javax.xml.namespace.QName("http://geronimo.apache.org/xml/ns/naming-1.2", "service-name");
024        private static final javax.xml.namespace.QName PORTCOMPLETION$2 = 
025            new javax.xml.namespace.QName("http://geronimo.apache.org/xml/ns/naming-1.2", "port-completion");
026        
027        
028        /**
029         * Gets the "service-name" element
030         */
031        public java.lang.String getServiceName()
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(SERVICENAME$0, 0);
038                if (target == null)
039                {
040                    return null;
041                }
042                return target.getStringValue();
043            }
044        }
045        
046        /**
047         * Gets (as xml) the "service-name" element
048         */
049        public org.apache.xmlbeans.XmlString xgetServiceName()
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(SERVICENAME$0, 0);
056                return target;
057            }
058        }
059        
060        /**
061         * Sets the "service-name" element
062         */
063        public void setServiceName(java.lang.String serviceName)
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(SERVICENAME$0, 0);
070                if (target == null)
071                {
072                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(SERVICENAME$0);
073                }
074                target.setStringValue(serviceName);
075            }
076        }
077        
078        /**
079         * Sets (as xml) the "service-name" element
080         */
081        public void xsetServiceName(org.apache.xmlbeans.XmlString serviceName)
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(SERVICENAME$0, 0);
088                if (target == null)
089                {
090                    target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(SERVICENAME$0);
091                }
092                target.set(serviceName);
093            }
094        }
095        
096        /**
097         * Gets array of all "port-completion" elements
098         */
099        public org.apache.geronimo.xbeans.geronimo.naming.GerPortCompletionType[] getPortCompletionArray()
100        {
101            synchronized (monitor())
102            {
103                check_orphaned();
104                java.util.List targetList = new java.util.ArrayList();
105                get_store().find_all_element_users(PORTCOMPLETION$2, targetList);
106                org.apache.geronimo.xbeans.geronimo.naming.GerPortCompletionType[] result = new org.apache.geronimo.xbeans.geronimo.naming.GerPortCompletionType[targetList.size()];
107                targetList.toArray(result);
108                return result;
109            }
110        }
111        
112        /**
113         * Gets ith "port-completion" element
114         */
115        public org.apache.geronimo.xbeans.geronimo.naming.GerPortCompletionType getPortCompletionArray(int i)
116        {
117            synchronized (monitor())
118            {
119                check_orphaned();
120                org.apache.geronimo.xbeans.geronimo.naming.GerPortCompletionType target = null;
121                target = (org.apache.geronimo.xbeans.geronimo.naming.GerPortCompletionType)get_store().find_element_user(PORTCOMPLETION$2, i);
122                if (target == null)
123                {
124                    throw new IndexOutOfBoundsException();
125                }
126                return target;
127            }
128        }
129        
130        /**
131         * Returns number of "port-completion" element
132         */
133        public int sizeOfPortCompletionArray()
134        {
135            synchronized (monitor())
136            {
137                check_orphaned();
138                return get_store().count_elements(PORTCOMPLETION$2);
139            }
140        }
141        
142        /**
143         * Sets array of all "port-completion" element
144         */
145        public void setPortCompletionArray(org.apache.geronimo.xbeans.geronimo.naming.GerPortCompletionType[] portCompletionArray)
146        {
147            synchronized (monitor())
148            {
149                check_orphaned();
150                arraySetterHelper(portCompletionArray, PORTCOMPLETION$2);
151            }
152        }
153        
154        /**
155         * Sets ith "port-completion" element
156         */
157        public void setPortCompletionArray(int i, org.apache.geronimo.xbeans.geronimo.naming.GerPortCompletionType portCompletion)
158        {
159            synchronized (monitor())
160            {
161                check_orphaned();
162                org.apache.geronimo.xbeans.geronimo.naming.GerPortCompletionType target = null;
163                target = (org.apache.geronimo.xbeans.geronimo.naming.GerPortCompletionType)get_store().find_element_user(PORTCOMPLETION$2, i);
164                if (target == null)
165                {
166                    throw new IndexOutOfBoundsException();
167                }
168                target.set(portCompletion);
169            }
170        }
171        
172        /**
173         * Inserts and returns a new empty value (as xml) as the ith "port-completion" element
174         */
175        public org.apache.geronimo.xbeans.geronimo.naming.GerPortCompletionType insertNewPortCompletion(int i)
176        {
177            synchronized (monitor())
178            {
179                check_orphaned();
180                org.apache.geronimo.xbeans.geronimo.naming.GerPortCompletionType target = null;
181                target = (org.apache.geronimo.xbeans.geronimo.naming.GerPortCompletionType)get_store().insert_element_user(PORTCOMPLETION$2, i);
182                return target;
183            }
184        }
185        
186        /**
187         * Appends and returns a new empty value (as xml) as the last "port-completion" element
188         */
189        public org.apache.geronimo.xbeans.geronimo.naming.GerPortCompletionType addNewPortCompletion()
190        {
191            synchronized (monitor())
192            {
193                check_orphaned();
194                org.apache.geronimo.xbeans.geronimo.naming.GerPortCompletionType target = null;
195                target = (org.apache.geronimo.xbeans.geronimo.naming.GerPortCompletionType)get_store().add_element_user(PORTCOMPLETION$2);
196                return target;
197            }
198        }
199        
200        /**
201         * Removes the ith "port-completion" element
202         */
203        public void removePortCompletion(int i)
204        {
205            synchronized (monitor())
206            {
207                check_orphaned();
208                get_store().remove_element(PORTCOMPLETION$2, i);
209            }
210        }
211    }