/*
 * An XML document type.
 * Localname: DynamicProperties
 * Namespace: http://www.bea.com/wli/control/dynamicProperties
 * Java type: com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument
 *
 * Automatically generated - do not modify.
 */
package com.bea.wli.control.dynamicProperties.impl;
/**
 * A document containing one DynamicProperties(@http://www.bea.com/wli/control/dynamicProperties) element.
 *
 * This is a complex type.
 */
public class DynamicPropertiesDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument
{
    
    public DynamicPropertiesDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName DYNAMICPROPERTIES$0 = 
        new javax.xml.namespace.QName("http://www.bea.com/wli/control/dynamicProperties", "DynamicProperties");
    
    
    /**
     * Gets the "DynamicProperties" element
     */
    public com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties getDynamicProperties()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties target = null;
            target = (com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties)get_store().find_element_user(DYNAMICPROPERTIES$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "DynamicProperties" element
     */
    public void setDynamicProperties(com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties dynamicProperties)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties target = null;
            target = (com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties)get_store().find_element_user(DYNAMICPROPERTIES$0, 0);
            if (target == null)
            {
                target = (com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties)get_store().add_element_user(DYNAMICPROPERTIES$0);
            }
            target.set(dynamicProperties);
        }
    }
    
    /**
     * Appends and returns a new empty "DynamicProperties" element
     */
    public com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties addNewDynamicProperties()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties target = null;
            target = (com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties)get_store().add_element_user(DYNAMICPROPERTIES$0);
            return target;
        }
    }
    /**
     * An XML DynamicProperties(@http://www.bea.com/wli/control/dynamicProperties).
     *
     * This is a complex type.
     */
    public static class DynamicPropertiesImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties
    {
        
        public DynamicPropertiesImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }
        
        private static final javax.xml.namespace.QName CONTROL$0 = 
            new javax.xml.namespace.QName("http://www.bea.com/wli/control/dynamicProperties", "control");
        
        
        /**
         * Gets a List of "control" elements
         */
        public java.util.List<com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control> getControlList()
        {
            final class ControlList extends java.util.AbstractList<com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control>
            {
                public com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control get(int i)
                    { return DynamicPropertiesImpl.this.getControlArray(i); }
                
                public com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control set(int i, com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control o)
                {
                    com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control old = DynamicPropertiesImpl.this.getControlArray(i);
                    DynamicPropertiesImpl.this.setControlArray(i, o);
                    return old;
                }
                
                public void add(int i, com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control o)
                    { DynamicPropertiesImpl.this.insertNewControl(i).set(o); }
                
                public com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control remove(int i)
                {
                    com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control old = DynamicPropertiesImpl.this.getControlArray(i);
                    DynamicPropertiesImpl.this.removeControl(i);
                    return old;
                }
                
                public int size()
                    { return DynamicPropertiesImpl.this.sizeOfControlArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new ControlList();
            }
        }
        
        /**
         * Gets array of all "control" elements
         */
        public com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control[] getControlArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(CONTROL$0, targetList);
                com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control[] result = new com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "control" element
         */
        public com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control getControlArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control target = null;
                target = (com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control)get_store().find_element_user(CONTROL$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "control" element
         */
        public int sizeOfControlArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(CONTROL$0);
            }
        }
        
        /**
         * Sets array of all "control" element
         */
        public void setControlArray(com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control[] controlArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(controlArray, CONTROL$0);
            }
        }
        
        /**
         * Sets ith "control" element
         */
        public void setControlArray(int i, com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control control)
        {
            synchronized (monitor())
            {
                check_orphaned();
                com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control target = null;
                target = (com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control)get_store().find_element_user(CONTROL$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(control);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "control" element
         */
        public com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control insertNewControl(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control target = null;
                target = (com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control)get_store().insert_element_user(CONTROL$0, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "control" element
         */
        public com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control addNewControl()
        {
            synchronized (monitor())
            {
                check_orphaned();
                com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control target = null;
                target = (com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control)get_store().add_element_user(CONTROL$0);
                return target;
            }
        }
        
        /**
         * Removes the ith "control" element
         */
        public void removeControl(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(CONTROL$0, i);
            }
        }
        /**
         * An XML control(@http://www.bea.com/wli/control/dynamicProperties).
         *
         * This is a complex type.
         */
        public static class ControlImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.bea.wli.control.dynamicProperties.DynamicPropertiesDocument.DynamicProperties.Control
        {
            
            public ControlImpl(org.apache.xmlbeans.SchemaType sType)
            {
                super(sType);
            }
            
            private static final javax.xml.namespace.QName KEY$0 = 
                new javax.xml.namespace.QName("http://www.bea.com/wli/control/dynamicProperties", "key");
            private static final javax.xml.namespace.QName CONTEXTPATH$2 = 
                new javax.xml.namespace.QName("", "context-path");
            private static final javax.xml.namespace.QName CLASSNAME$4 = 
                new javax.xml.namespace.QName("", "class-name");
            private static final javax.xml.namespace.QName CONTROLTYPE$6 = 
                new javax.xml.namespace.QName("", "controlType");
            
            
            /**
             * Gets a List of "key" elements
             */
            public java.util.List<com.bea.wli.control.dynamicProperties.ControlPropertiesType> getKeyList()
            {
                final class KeyList extends java.util.AbstractList<com.bea.wli.control.dynamicProperties.ControlPropertiesType>
                {
                    public com.bea.wli.control.dynamicProperties.ControlPropertiesType get(int i)
                        { return ControlImpl.this.getKeyArray(i); }
                    
                    public com.bea.wli.control.dynamicProperties.ControlPropertiesType set(int i, com.bea.wli.control.dynamicProperties.ControlPropertiesType o)
                    {
                      com.bea.wli.control.dynamicProperties.ControlPropertiesType old = ControlImpl.this.getKeyArray(i);
                      ControlImpl.this.setKeyArray(i, o);
                      return old;
                    }
                    
                    public void add(int i, com.bea.wli.control.dynamicProperties.ControlPropertiesType o)
                        { ControlImpl.this.insertNewKey(i).set(o); }
                    
                    public com.bea.wli.control.dynamicProperties.ControlPropertiesType remove(int i)
                    {
                      com.bea.wli.control.dynamicProperties.ControlPropertiesType old = ControlImpl.this.getKeyArray(i);
                      ControlImpl.this.removeKey(i);
                      return old;
                    }
                    
                    public int size()
                        { return ControlImpl.this.sizeOfKeyArray(); }
                    
                }
                
                synchronized (monitor())
                {
                    check_orphaned();
                    return new KeyList();
                }
            }
            
            /**
             * Gets array of all "key" elements
             */
            public com.bea.wli.control.dynamicProperties.ControlPropertiesType[] getKeyArray()
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    java.util.List targetList = new java.util.ArrayList();
                    get_store().find_all_element_users(KEY$0, targetList);
                    com.bea.wli.control.dynamicProperties.ControlPropertiesType[] result = new com.bea.wli.control.dynamicProperties.ControlPropertiesType[targetList.size()];
                    targetList.toArray(result);
                    return result;
                }
            }
            
            /**
             * Gets ith "key" element
             */
            public com.bea.wli.control.dynamicProperties.ControlPropertiesType getKeyArray(int i)
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    com.bea.wli.control.dynamicProperties.ControlPropertiesType target = null;
                    target = (com.bea.wli.control.dynamicProperties.ControlPropertiesType)get_store().find_element_user(KEY$0, i);
                    if (target == null)
                    {
                      throw new IndexOutOfBoundsException();
                    }
                    return target;
                }
            }
            
            /**
             * Returns number of "key" element
             */
            public int sizeOfKeyArray()
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    return get_store().count_elements(KEY$0);
                }
            }
            
            /**
             * Sets array of all "key" element
             */
            public void setKeyArray(com.bea.wli.control.dynamicProperties.ControlPropertiesType[] keyArray)
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    arraySetterHelper(keyArray, KEY$0);
                }
            }
            
            /**
             * Sets ith "key" element
             */
            public void setKeyArray(int i, com.bea.wli.control.dynamicProperties.ControlPropertiesType key)
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    com.bea.wli.control.dynamicProperties.ControlPropertiesType target = null;
                    target = (com.bea.wli.control.dynamicProperties.ControlPropertiesType)get_store().find_element_user(KEY$0, i);
                    if (target == null)
                    {
                      throw new IndexOutOfBoundsException();
                    }
                    target.set(key);
                }
            }
            
            /**
             * Inserts and returns a new empty value (as xml) as the ith "key" element
             */
            public com.bea.wli.control.dynamicProperties.ControlPropertiesType insertNewKey(int i)
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    com.bea.wli.control.dynamicProperties.ControlPropertiesType target = null;
                    target = (com.bea.wli.control.dynamicProperties.ControlPropertiesType)get_store().insert_element_user(KEY$0, i);
                    return target;
                }
            }
            
            /**
             * Appends and returns a new empty value (as xml) as the last "key" element
             */
            public com.bea.wli.control.dynamicProperties.ControlPropertiesType addNewKey()
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    com.bea.wli.control.dynamicProperties.ControlPropertiesType target = null;
                    target = (com.bea.wli.control.dynamicProperties.ControlPropertiesType)get_store().add_element_user(KEY$0);
                    return target;
                }
            }
            
            /**
             * Removes the ith "key" element
             */
            public void removeKey(int i)
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    get_store().remove_element(KEY$0, i);
                }
            }
            
            /**
             * Gets the "context-path" attribute
             */
            public java.lang.String getContextPath()
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    org.apache.xmlbeans.SimpleValue target = null;
                    target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(CONTEXTPATH$2);
                    if (target == null)
                    {
                      return null;
                    }
                    return target.getStringValue();
                }
            }
            
            /**
             * Gets (as xml) the "context-path" attribute
             */
            public org.apache.xmlbeans.XmlString xgetContextPath()
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    org.apache.xmlbeans.XmlString target = null;
                    target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(CONTEXTPATH$2);
                    return target;
                }
            }
            
            /**
             * True if has "context-path" attribute
             */
            public boolean isSetContextPath()
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    return get_store().find_attribute_user(CONTEXTPATH$2) != null;
                }
            }
            
            /**
             * Sets the "context-path" attribute
             */
            public void setContextPath(java.lang.String contextPath)
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    org.apache.xmlbeans.SimpleValue target = null;
                    target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(CONTEXTPATH$2);
                    if (target == null)
                    {
                      target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(CONTEXTPATH$2);
                    }
                    target.setStringValue(contextPath);
                }
            }
            
            /**
             * Sets (as xml) the "context-path" attribute
             */
            public void xsetContextPath(org.apache.xmlbeans.XmlString contextPath)
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    org.apache.xmlbeans.XmlString target = null;
                    target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(CONTEXTPATH$2);
                    if (target == null)
                    {
                      target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(CONTEXTPATH$2);
                    }
                    target.set(contextPath);
                }
            }
            
            /**
             * Unsets the "context-path" attribute
             */
            public void unsetContextPath()
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    get_store().remove_attribute(CONTEXTPATH$2);
                }
            }
            
            /**
             * Gets the "class-name" attribute
             */
            public java.lang.String getClassName()
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    org.apache.xmlbeans.SimpleValue target = null;
                    target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(CLASSNAME$4);
                    if (target == null)
                    {
                      return null;
                    }
                    return target.getStringValue();
                }
            }
            
            /**
             * Gets (as xml) the "class-name" attribute
             */
            public org.apache.xmlbeans.XmlString xgetClassName()
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    org.apache.xmlbeans.XmlString target = null;
                    target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(CLASSNAME$4);
                    return target;
                }
            }
            
            /**
             * True if has "class-name" attribute
             */
            public boolean isSetClassName()
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    return get_store().find_attribute_user(CLASSNAME$4) != null;
                }
            }
            
            /**
             * Sets the "class-name" attribute
             */
            public void setClassName(java.lang.String className)
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    org.apache.xmlbeans.SimpleValue target = null;
                    target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(CLASSNAME$4);
                    if (target == null)
                    {
                      target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(CLASSNAME$4);
                    }
                    target.setStringValue(className);
                }
            }
            
            /**
             * Sets (as xml) the "class-name" attribute
             */
            public void xsetClassName(org.apache.xmlbeans.XmlString className)
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    org.apache.xmlbeans.XmlString target = null;
                    target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(CLASSNAME$4);
                    if (target == null)
                    {
                      target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(CLASSNAME$4);
                    }
                    target.set(className);
                }
            }
            
            /**
             * Unsets the "class-name" attribute
             */
            public void unsetClassName()
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    get_store().remove_attribute(CLASSNAME$4);
                }
            }
            
            /**
             * Gets the "controlType" attribute
             */
            public com.bea.wli.control.dynamicProperties.ControlType.Enum getControlType()
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    org.apache.xmlbeans.SimpleValue target = null;
                    target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(CONTROLTYPE$6);
                    if (target == null)
                    {
                      return null;
                    }
                    return (com.bea.wli.control.dynamicProperties.ControlType.Enum)target.getEnumValue();
                }
            }
            
            /**
             * Gets (as xml) the "controlType" attribute
             */
            public com.bea.wli.control.dynamicProperties.ControlType xgetControlType()
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    com.bea.wli.control.dynamicProperties.ControlType target = null;
                    target = (com.bea.wli.control.dynamicProperties.ControlType)get_store().find_attribute_user(CONTROLTYPE$6);
                    return target;
                }
            }
            
            /**
             * True if has "controlType" attribute
             */
            public boolean isSetControlType()
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    return get_store().find_attribute_user(CONTROLTYPE$6) != null;
                }
            }
            
            /**
             * Sets the "controlType" attribute
             */
            public void setControlType(com.bea.wli.control.dynamicProperties.ControlType.Enum controlType)
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    org.apache.xmlbeans.SimpleValue target = null;
                    target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(CONTROLTYPE$6);
                    if (target == null)
                    {
                      target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(CONTROLTYPE$6);
                    }
                    target.setEnumValue(controlType);
                }
            }
            
            /**
             * Sets (as xml) the "controlType" attribute
             */
            public void xsetControlType(com.bea.wli.control.dynamicProperties.ControlType controlType)
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    com.bea.wli.control.dynamicProperties.ControlType target = null;
                    target = (com.bea.wli.control.dynamicProperties.ControlType)get_store().find_attribute_user(CONTROLTYPE$6);
                    if (target == null)
                    {
                      target = (com.bea.wli.control.dynamicProperties.ControlType)get_store().add_attribute_user(CONTROLTYPE$6);
                    }
                    target.set(controlType);
                }
            }
            
            /**
             * Unsets the "controlType" attribute
             */
            public void unsetControlType()
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    get_store().remove_attribute(CONTROLTYPE$6);
                }
            }
        }
    }
}
