/*
 * An XML document type.
 * Localname: Recipient
 * Namespace: http://schemas.xmlsoap.org/ws/2003/03/addressing
 * Java type: org.activemq.ws.xmlbeans.addressing.v2003_03.RecipientDocument
 *
 * Automatically generated - do not modify.
 */
package org.activemq.ws.xmlbeans.addressing.v2003_03.impl;
/**
 * A document containing one Recipient(@http://schemas.xmlsoap.org/ws/2003/03/addressing) element.
 *
 * This is a complex type.
 */
public class RecipientDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.addressing.v2003_03.RecipientDocument
{
    
    public RecipientDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName RECIPIENT$0 = 
        new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2003/03/addressing", "Recipient");
    
    
    /**
     * Gets the "Recipient" element
     */
    public org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType getRecipient()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType target = null;
            target = (org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType)get_store().find_element_user(RECIPIENT$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "Recipient" element
     */
    public void setRecipient(org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType recipient)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType target = null;
            target = (org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType)get_store().find_element_user(RECIPIENT$0, 0);
            if (target == null)
            {
                target = (org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType)get_store().add_element_user(RECIPIENT$0);
            }
            target.set(recipient);
        }
    }
    
    /**
     * Appends and returns a new empty "Recipient" element
     */
    public org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType addNewRecipient()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType target = null;
            target = (org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType)get_store().add_element_user(RECIPIENT$0);
            return target;
        }
    }
}
