/*
 * An XML document type.
 * Localname: MessageOrder
 * Namespace: http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd
 * Java type: org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageOrderDocument
 *
 * Automatically generated - do not modify.
 */
package org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.impl;
/**
 * A document containing one MessageOrder(@http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd) element.
 *
 * This is a complex type.
 */
public class MessageOrderDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageOrderDocument
{
    
    public MessageOrderDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName MESSAGEORDER$0 = 
        new javax.xml.namespace.QName("http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd", "MessageOrder");
    
    
    /**
     * Gets the "MessageOrder" element
     */
    public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageOrderDocument.MessageOrder getMessageOrder()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageOrderDocument.MessageOrder target = null;
            target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageOrderDocument.MessageOrder)get_store().find_element_user(MESSAGEORDER$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "MessageOrder" element
     */
    public void setMessageOrder(org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageOrderDocument.MessageOrder messageOrder)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageOrderDocument.MessageOrder target = null;
            target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageOrderDocument.MessageOrder)get_store().find_element_user(MESSAGEORDER$0, 0);
            if (target == null)
            {
                target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageOrderDocument.MessageOrder)get_store().add_element_user(MESSAGEORDER$0);
            }
            target.set(messageOrder);
        }
    }
    
    /**
     * Appends and returns a new empty "MessageOrder" element
     */
    public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageOrderDocument.MessageOrder addNewMessageOrder()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageOrderDocument.MessageOrder target = null;
            target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageOrderDocument.MessageOrder)get_store().add_element_user(MESSAGEORDER$0);
            return target;
        }
    }
    /**
     * An XML MessageOrder(@http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd).
     *
     * This is a complex type.
     */
    public static class MessageOrderImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageOrderDocument.MessageOrder
    {
        
        public MessageOrderImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }
        
        private static final javax.xml.namespace.QName SEQUENCENUMBER$0 = 
            new javax.xml.namespace.QName("http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd", "SequenceNumber");
        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");
        
        
        /**
         * Gets the "SequenceNumber" element
         */
        public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SequenceNumberType getSequenceNumber()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SequenceNumberType target = null;
                target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SequenceNumberType)get_store().find_element_user(SEQUENCENUMBER$0, 0);
                if (target == null)
                {
                    return null;
                }
                return target;
            }
        }
        
        /**
         * Sets the "SequenceNumber" element
         */
        public void setSequenceNumber(org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SequenceNumberType sequenceNumber)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SequenceNumberType target = null;
                target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SequenceNumberType)get_store().find_element_user(SEQUENCENUMBER$0, 0);
                if (target == null)
                {
                    target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SequenceNumberType)get_store().add_element_user(SEQUENCENUMBER$0);
                }
                target.set(sequenceNumber);
            }
        }
        
        /**
         * Appends and returns a new empty "SequenceNumber" element
         */
        public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SequenceNumberType addNewSequenceNumber()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SequenceNumberType target = null;
                target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.SequenceNumberType)get_store().add_element_user(SEQUENCENUMBER$0);
                return target;
            }
        }
        
        /**
         * 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);
            }
        }
    }
}
