/*
 * An XML document type.
 * Localname: From
 * Namespace: http://schemas.xmlsoap.org/ws/2004/08/addressing
 * Java type: org.codehaus.activemq.ws.schema.addressing.FromDocument
 *
 * Automatically generated - do not modify.
 */
package org.codehaus.activemq.ws.schema.addressing.impl;

/**
 * A document containing one From(@http://schemas.xmlsoap.org/ws/2004/08/addressing) element.
 * <p/>
 * This is a complex type.
 */
public class FromDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.codehaus.activemq.ws.schema.addressing.FromDocument {

    public FromDocumentImpl(org.apache.xmlbeans.SchemaType sType) {
        super(sType);
    }

    private static final javax.xml.namespace.QName FROM$0 =
            new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/08/addressing", "From");


    /**
     * Gets the "From" element
     */
    public org.codehaus.activemq.ws.schema.addressing.EndpointReferenceType getFrom() {
        synchronized (monitor()) {
            check_orphaned();
            org.codehaus.activemq.ws.schema.addressing.EndpointReferenceType target = null;
            target = (org.codehaus.activemq.ws.schema.addressing.EndpointReferenceType) get_store().find_element_user(FROM$0, 0);
            if (target == null) {
                return null;
            }
            return target;
        }
    }

    /**
     * Sets the "From" element
     */
    public void setFrom(org.codehaus.activemq.ws.schema.addressing.EndpointReferenceType from) {
        synchronized (monitor()) {
            check_orphaned();
            org.codehaus.activemq.ws.schema.addressing.EndpointReferenceType target = null;
            target = (org.codehaus.activemq.ws.schema.addressing.EndpointReferenceType) get_store().find_element_user(FROM$0, 0);
            if (target == null) {
                target = (org.codehaus.activemq.ws.schema.addressing.EndpointReferenceType) get_store().add_element_user(FROM$0);
            }
            target.set(from);
        }
    }

    /**
     * Appends and returns a new empty "From" element
     */
    public org.codehaus.activemq.ws.schema.addressing.EndpointReferenceType addNewFrom() {
        synchronized (monitor()) {
            check_orphaned();
            org.codehaus.activemq.ws.schema.addressing.EndpointReferenceType target = null;
            target = (org.codehaus.activemq.ws.schema.addressing.EndpointReferenceType) get_store().add_element_user(FROM$0);
            return target;
        }
    }
}
