/*
 * An XML document type.
 * Localname: ErrorList
 * Namespace: http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd
 * Java type: org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorListDocument
 *
 * Automatically generated - do not modify.
 */
package org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.impl;
/**
 * A document containing one ErrorList(@http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd) element.
 *
 * This is a complex type.
 */
public class ErrorListDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorListDocument
{
    
    public ErrorListDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName ERRORLIST$0 = 
        new javax.xml.namespace.QName("http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd", "ErrorList");
    
    
    /**
     * Gets the "ErrorList" element
     */
    public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorListDocument.ErrorList getErrorList()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorListDocument.ErrorList target = null;
            target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorListDocument.ErrorList)get_store().find_element_user(ERRORLIST$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "ErrorList" element
     */
    public void setErrorList(org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorListDocument.ErrorList errorList)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorListDocument.ErrorList target = null;
            target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorListDocument.ErrorList)get_store().find_element_user(ERRORLIST$0, 0);
            if (target == null)
            {
                target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorListDocument.ErrorList)get_store().add_element_user(ERRORLIST$0);
            }
            target.set(errorList);
        }
    }
    
    /**
     * Appends and returns a new empty "ErrorList" element
     */
    public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorListDocument.ErrorList addNewErrorList()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorListDocument.ErrorList target = null;
            target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorListDocument.ErrorList)get_store().add_element_user(ERRORLIST$0);
            return target;
        }
    }
    /**
     * An XML ErrorList(@http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd).
     *
     * This is a complex type.
     */
    public static class ErrorListImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorListDocument.ErrorList
    {
        
        public ErrorListImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }
        
        private static final javax.xml.namespace.QName ERROR$0 = 
            new javax.xml.namespace.QName("http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd", "Error");
        private static final javax.xml.namespace.QName ID$2 = 
            new javax.xml.namespace.QName("http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd", "id");
        private static final javax.xml.namespace.QName VERSION$4 = 
            new javax.xml.namespace.QName("http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd", "version");
        private static final javax.xml.namespace.QName MUSTUNDERSTAND$6 = 
            new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/envelope/", "mustUnderstand");
        private static final javax.xml.namespace.QName HIGHESTSEVERITY$8 = 
            new javax.xml.namespace.QName("http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd", "highestSeverity");
        
        
        /**
         * Gets a List of "Error" elements
         */
        public java.util.List<org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error> getErrorList()
        {
            final class ErrorList extends java.util.AbstractList<org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error>
            {
                public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error get(int i)
                    { return ErrorListImpl.this.getErrorArray(i); }
                
                public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error set(int i, org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error o)
                {
                    org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error old = ErrorListImpl.this.getErrorArray(i);
                    ErrorListImpl.this.setErrorArray(i, o);
                    return old;
                }
                
                public void add(int i, org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error o)
                    { ErrorListImpl.this.insertNewError(i).set(o); }
                
                public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error remove(int i)
                {
                    org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error old = ErrorListImpl.this.getErrorArray(i);
                    ErrorListImpl.this.removeError(i);
                    return old;
                }
                
                public int size()
                    { return ErrorListImpl.this.sizeOfErrorArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new ErrorList();
            }
        }
        
        /**
         * Gets array of all "Error" elements
         */
        public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error[] getErrorArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(ERROR$0, targetList);
                org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error[] result = new org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "Error" element
         */
        public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error getErrorArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error target = null;
                target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error)get_store().find_element_user(ERROR$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "Error" element
         */
        public int sizeOfErrorArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(ERROR$0);
            }
        }
        
        /**
         * Sets array of all "Error" element
         */
        public void setErrorArray(org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error[] errorArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(errorArray, ERROR$0);
            }
        }
        
        /**
         * Sets ith "Error" element
         */
        public void setErrorArray(int i, org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error error)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error target = null;
                target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error)get_store().find_element_user(ERROR$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(error);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "Error" element
         */
        public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error insertNewError(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error target = null;
                target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error)get_store().insert_element_user(ERROR$0, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "Error" element
         */
        public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error addNewError()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error target = null;
                target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorDocument.Error)get_store().add_element_user(ERROR$0);
                return target;
            }
        }
        
        /**
         * Removes the ith "Error" element
         */
        public void removeError(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(ERROR$0, i);
            }
        }
        
        /**
         * Gets the "id" attribute
         */
        public java.lang.String getId()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ID$2);
                if (target == null)
                {
                    return null;
                }
                return target.getStringValue();
            }
        }
        
        /**
         * Gets (as xml) the "id" attribute
         */
        public org.apache.xmlbeans.XmlID xgetId()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlID target = null;
                target = (org.apache.xmlbeans.XmlID)get_store().find_attribute_user(ID$2);
                return target;
            }
        }
        
        /**
         * True if has "id" attribute
         */
        public boolean isSetId()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().find_attribute_user(ID$2) != null;
            }
        }
        
        /**
         * Sets the "id" attribute
         */
        public void setId(java.lang.String id)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ID$2);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(ID$2);
                }
                target.setStringValue(id);
            }
        }
        
        /**
         * Sets (as xml) the "id" attribute
         */
        public void xsetId(org.apache.xmlbeans.XmlID id)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlID target = null;
                target = (org.apache.xmlbeans.XmlID)get_store().find_attribute_user(ID$2);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlID)get_store().add_attribute_user(ID$2);
                }
                target.set(id);
            }
        }
        
        /**
         * Unsets the "id" attribute
         */
        public void unsetId()
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_attribute(ID$2);
            }
        }
        
        /**
         * Gets the "version" attribute
         */
        public java.lang.String getVersion()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(VERSION$4);
                if (target == null)
                {
                    return null;
                }
                return target.getStringValue();
            }
        }
        
        /**
         * Gets (as xml) the "version" attribute
         */
        public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.NonEmptyString xgetVersion()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.NonEmptyString target = null;
                target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.NonEmptyString)get_store().find_attribute_user(VERSION$4);
                return target;
            }
        }
        
        /**
         * Sets the "version" attribute
         */
        public void setVersion(java.lang.String version)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(VERSION$4);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(VERSION$4);
                }
                target.setStringValue(version);
            }
        }
        
        /**
         * Sets (as xml) the "version" attribute
         */
        public void xsetVersion(org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.NonEmptyString version)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.NonEmptyString target = null;
                target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.NonEmptyString)get_store().find_attribute_user(VERSION$4);
                if (target == null)
                {
                    target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.NonEmptyString)get_store().add_attribute_user(VERSION$4);
                }
                target.set(version);
            }
        }
        
        /**
         * Gets the "mustUnderstand" attribute
         */
        public boolean getMustUnderstand()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(MUSTUNDERSTAND$6);
                if (target == null)
                {
                    return false;
                }
                return target.getBooleanValue();
            }
        }
        
        /**
         * Gets (as xml) the "mustUnderstand" attribute
         */
        public org.xmlsoap.schemas.soap.envelope.MustUnderstandAttribute.MustUnderstand xgetMustUnderstand()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.xmlsoap.schemas.soap.envelope.MustUnderstandAttribute.MustUnderstand target = null;
                target = (org.xmlsoap.schemas.soap.envelope.MustUnderstandAttribute.MustUnderstand)get_store().find_attribute_user(MUSTUNDERSTAND$6);
                return target;
            }
        }
        
        /**
         * Sets the "mustUnderstand" attribute
         */
        public void setMustUnderstand(boolean mustUnderstand)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(MUSTUNDERSTAND$6);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(MUSTUNDERSTAND$6);
                }
                target.setBooleanValue(mustUnderstand);
            }
        }
        
        /**
         * Sets (as xml) the "mustUnderstand" attribute
         */
        public void xsetMustUnderstand(org.xmlsoap.schemas.soap.envelope.MustUnderstandAttribute.MustUnderstand mustUnderstand)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.xmlsoap.schemas.soap.envelope.MustUnderstandAttribute.MustUnderstand target = null;
                target = (org.xmlsoap.schemas.soap.envelope.MustUnderstandAttribute.MustUnderstand)get_store().find_attribute_user(MUSTUNDERSTAND$6);
                if (target == null)
                {
                    target = (org.xmlsoap.schemas.soap.envelope.MustUnderstandAttribute.MustUnderstand)get_store().add_attribute_user(MUSTUNDERSTAND$6);
                }
                target.set(mustUnderstand);
            }
        }
        
        /**
         * Gets the "highestSeverity" attribute
         */
        public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SeverityType.Enum getHighestSeverity()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(HIGHESTSEVERITY$8);
                if (target == null)
                {
                    return null;
                }
                return (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SeverityType.Enum)target.getEnumValue();
            }
        }
        
        /**
         * Gets (as xml) the "highestSeverity" attribute
         */
        public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SeverityType xgetHighestSeverity()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SeverityType target = null;
                target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SeverityType)get_store().find_attribute_user(HIGHESTSEVERITY$8);
                return target;
            }
        }
        
        /**
         * Sets the "highestSeverity" attribute
         */
        public void setHighestSeverity(org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SeverityType.Enum highestSeverity)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(HIGHESTSEVERITY$8);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(HIGHESTSEVERITY$8);
                }
                target.setEnumValue(highestSeverity);
            }
        }
        
        /**
         * Sets (as xml) the "highestSeverity" attribute
         */
        public void xsetHighestSeverity(org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SeverityType highestSeverity)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SeverityType target = null;
                target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SeverityType)get_store().find_attribute_user(HIGHESTSEVERITY$8);
                if (target == null)
                {
                    target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SeverityType)get_store().add_attribute_user(HIGHESTSEVERITY$8);
                }
                target.set(highestSeverity);
            }
        }
    }
}
