/*
 * XML Type:  Header
 * Namespace: http://schemas.xmlsoap.org/soap/envelope/
 * Java type: org.xmlsoap.schemas.soap.envelope.Header
 *
 * Automatically generated - do not modify.
 */
package org.xmlsoap.schemas.soap.envelope.impl;
/**
 * An XML Header(@http://schemas.xmlsoap.org/soap/envelope/).
 *
 * This is a complex type.
 */
public class HeaderImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.xmlsoap.schemas.soap.envelope.Header
{
    
    public HeaderImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName MESSAGEHEADER$0 = 
        new javax.xml.namespace.QName("http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd", "MessageHeader");
    private static final javax.xml.namespace.QName ACKREQUESTED$2 = 
        new javax.xml.namespace.QName("http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd", "AckRequested");
    private static final javax.xml.namespace.QName ACKNOWLEDGMENT$4 = 
        new javax.xml.namespace.QName("http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd", "Acknowledgment");
    private static final javax.xml.namespace.QName ERRORLIST$6 = 
        new javax.xml.namespace.QName("http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd", "ErrorList");
    
    
    /**
     * Gets the "MessageHeader" element
     */
    public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageHeaderDocument.MessageHeader getMessageHeader()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageHeaderDocument.MessageHeader target = null;
            target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageHeaderDocument.MessageHeader)get_store().find_element_user(MESSAGEHEADER$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "MessageHeader" element
     */
    public void setMessageHeader(org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageHeaderDocument.MessageHeader messageHeader)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageHeaderDocument.MessageHeader target = null;
            target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageHeaderDocument.MessageHeader)get_store().find_element_user(MESSAGEHEADER$0, 0);
            if (target == null)
            {
                target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageHeaderDocument.MessageHeader)get_store().add_element_user(MESSAGEHEADER$0);
            }
            target.set(messageHeader);
        }
    }
    
    /**
     * Appends and returns a new empty "MessageHeader" element
     */
    public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageHeaderDocument.MessageHeader addNewMessageHeader()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageHeaderDocument.MessageHeader target = null;
            target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.MessageHeaderDocument.MessageHeader)get_store().add_element_user(MESSAGEHEADER$0);
            return target;
        }
    }
    
    /**
     * Gets the "AckRequested" element
     */
    public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.AckRequestedDocument.AckRequested getAckRequested()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.AckRequestedDocument.AckRequested target = null;
            target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.AckRequestedDocument.AckRequested)get_store().find_element_user(ACKREQUESTED$2, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "AckRequested" element
     */
    public boolean isSetAckRequested()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(ACKREQUESTED$2) != 0;
        }
    }
    
    /**
     * Sets the "AckRequested" element
     */
    public void setAckRequested(org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.AckRequestedDocument.AckRequested ackRequested)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.AckRequestedDocument.AckRequested target = null;
            target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.AckRequestedDocument.AckRequested)get_store().find_element_user(ACKREQUESTED$2, 0);
            if (target == null)
            {
                target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.AckRequestedDocument.AckRequested)get_store().add_element_user(ACKREQUESTED$2);
            }
            target.set(ackRequested);
        }
    }
    
    /**
     * Appends and returns a new empty "AckRequested" element
     */
    public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.AckRequestedDocument.AckRequested addNewAckRequested()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.AckRequestedDocument.AckRequested target = null;
            target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.AckRequestedDocument.AckRequested)get_store().add_element_user(ACKREQUESTED$2);
            return target;
        }
    }
    
    /**
     * Unsets the "AckRequested" element
     */
    public void unsetAckRequested()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(ACKREQUESTED$2, 0);
        }
    }
    
    /**
     * Gets the "Acknowledgment" element
     */
    public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.AcknowledgmentDocument.Acknowledgment getAcknowledgment()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.AcknowledgmentDocument.Acknowledgment target = null;
            target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.AcknowledgmentDocument.Acknowledgment)get_store().find_element_user(ACKNOWLEDGMENT$4, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "Acknowledgment" element
     */
    public boolean isSetAcknowledgment()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(ACKNOWLEDGMENT$4) != 0;
        }
    }
    
    /**
     * Sets the "Acknowledgment" element
     */
    public void setAcknowledgment(org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.AcknowledgmentDocument.Acknowledgment acknowledgment)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.AcknowledgmentDocument.Acknowledgment target = null;
            target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.AcknowledgmentDocument.Acknowledgment)get_store().find_element_user(ACKNOWLEDGMENT$4, 0);
            if (target == null)
            {
                target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.AcknowledgmentDocument.Acknowledgment)get_store().add_element_user(ACKNOWLEDGMENT$4);
            }
            target.set(acknowledgment);
        }
    }
    
    /**
     * Appends and returns a new empty "Acknowledgment" element
     */
    public org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.AcknowledgmentDocument.Acknowledgment addNewAcknowledgment()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.AcknowledgmentDocument.Acknowledgment target = null;
            target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.AcknowledgmentDocument.Acknowledgment)get_store().add_element_user(ACKNOWLEDGMENT$4);
            return target;
        }
    }
    
    /**
     * Unsets the "Acknowledgment" element
     */
    public void unsetAcknowledgment()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(ACKNOWLEDGMENT$4, 0);
        }
    }
    
    /**
     * 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$6, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "ErrorList" element
     */
    public boolean isSetErrorList()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(ERRORLIST$6) != 0;
        }
    }
    
    /**
     * 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$6, 0);
            if (target == null)
            {
                target = (org.oasisOpen.committees.ebxmlMsg.schema.msgHeader20.ErrorListDocument.ErrorList)get_store().add_element_user(ERRORLIST$6);
            }
            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$6);
            return target;
        }
    }
    
    /**
     * Unsets the "ErrorList" element
     */
    public void unsetErrorList()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(ERRORLIST$6, 0);
        }
    }
}
