/*
 * An XML document type.
 * Localname: Schema
 * Namespace: http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd
 * Java type: org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SchemaDocument
 *
 * Automatically generated - do not modify.
 */
package org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.impl;
/**
 * A document containing one Schema(@http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd) element.
 *
 * This is a complex type.
 */
public class SchemaDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SchemaDocument
{
    
    public SchemaDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName SCHEMA$0 = 
        new javax.xml.namespace.QName("http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd", "Schema");
    
    
    /**
     * Gets the "Schema" element
     */
    public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SchemaDocument.Schema getSchema()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SchemaDocument.Schema target = null;
            target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SchemaDocument.Schema)get_store().find_element_user(SCHEMA$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "Schema" element
     */
    public void setSchema(org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SchemaDocument.Schema schema)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SchemaDocument.Schema target = null;
            target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SchemaDocument.Schema)get_store().find_element_user(SCHEMA$0, 0);
            if (target == null)
            {
                target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SchemaDocument.Schema)get_store().add_element_user(SCHEMA$0);
            }
            target.set(schema);
        }
    }
    
    /**
     * Appends and returns a new empty "Schema" element
     */
    public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SchemaDocument.Schema addNewSchema()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SchemaDocument.Schema target = null;
            target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SchemaDocument.Schema)get_store().add_element_user(SCHEMA$0);
            return target;
        }
    }
    /**
     * An XML Schema(@http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd).
     *
     * This is a complex type.
     */
    public static class SchemaImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SchemaDocument.Schema
    {
        
        public SchemaImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }
        
        private static final javax.xml.namespace.QName LOCATION$0 = 
            new javax.xml.namespace.QName("http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd", "location");
        private static final javax.xml.namespace.QName VERSION$2 = 
            new javax.xml.namespace.QName("http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd", "version");
        
        
        /**
         * Gets the "location" attribute
         */
        public java.lang.String getLocation()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(LOCATION$0);
                if (target == null)
                {
                    return null;
                }
                return target.getStringValue();
            }
        }
        
        /**
         * Gets (as xml) the "location" attribute
         */
        public org.apache.xmlbeans.XmlAnyURI xgetLocation()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlAnyURI target = null;
                target = (org.apache.xmlbeans.XmlAnyURI)get_store().find_attribute_user(LOCATION$0);
                return target;
            }
        }
        
        /**
         * Sets the "location" attribute
         */
        public void setLocation(java.lang.String location)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(LOCATION$0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(LOCATION$0);
                }
                target.setStringValue(location);
            }
        }
        
        /**
         * Sets (as xml) the "location" attribute
         */
        public void xsetLocation(org.apache.xmlbeans.XmlAnyURI location)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlAnyURI target = null;
                target = (org.apache.xmlbeans.XmlAnyURI)get_store().find_attribute_user(LOCATION$0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlAnyURI)get_store().add_attribute_user(LOCATION$0);
                }
                target.set(location);
            }
        }
        
        /**
         * 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$2);
                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$2);
                return target;
            }
        }
        
        /**
         * True if has "version" attribute
         */
        public boolean isSetVersion()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().find_attribute_user(VERSION$2) != null;
            }
        }
        
        /**
         * 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$2);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(VERSION$2);
                }
                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$2);
                if (target == null)
                {
                    target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.NonEmptyString)get_store().add_attribute_user(VERSION$2);
                }
                target.set(version);
            }
        }
        
        /**
         * Unsets the "version" attribute
         */
        public void unsetVersion()
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_attribute(VERSION$2);
            }
        }
    }
}
