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