/*
 * An XML document type.
 * Localname: Add
 * Namespace: http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd
 * Java type: org.activemq.ws.xmlbeans.servicegroup.AddDocument
 *
 * Automatically generated - do not modify.
 */
package org.activemq.ws.xmlbeans.servicegroup.impl;
/**
 * A document containing one Add(@http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd) element.
 *
 * This is a complex type.
 */
public class AddDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.servicegroup.AddDocument
{
    
    public AddDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName ADD$0 = 
        new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd", "Add");
    
    
    /**
     * Gets the "Add" element
     */
    public org.activemq.ws.xmlbeans.servicegroup.AddDocument.Add getAdd()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.servicegroup.AddDocument.Add target = null;
            target = (org.activemq.ws.xmlbeans.servicegroup.AddDocument.Add)get_store().find_element_user(ADD$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "Add" element
     */
    public void setAdd(org.activemq.ws.xmlbeans.servicegroup.AddDocument.Add add)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.servicegroup.AddDocument.Add target = null;
            target = (org.activemq.ws.xmlbeans.servicegroup.AddDocument.Add)get_store().find_element_user(ADD$0, 0);
            if (target == null)
            {
                target = (org.activemq.ws.xmlbeans.servicegroup.AddDocument.Add)get_store().add_element_user(ADD$0);
            }
            target.set(add);
        }
    }
    
    /**
     * Appends and returns a new empty "Add" element
     */
    public org.activemq.ws.xmlbeans.servicegroup.AddDocument.Add addNewAdd()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.servicegroup.AddDocument.Add target = null;
            target = (org.activemq.ws.xmlbeans.servicegroup.AddDocument.Add)get_store().add_element_user(ADD$0);
            return target;
        }
    }
    /**
     * An XML Add(@http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd).
     *
     * This is a complex type.
     */
    public static class AddImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.servicegroup.AddDocument.Add
    {
        
        public AddImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }
        
        private static final javax.xml.namespace.QName MEMBEREPR$0 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd", "MemberEPR");
        private static final javax.xml.namespace.QName CONTENT$2 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd", "Content");
        private static final javax.xml.namespace.QName INITIALTERMINATIONTIME$4 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd", "InitialTerminationTime");
        
        
        /**
         * Gets the "MemberEPR" element
         */
        public org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType getMemberEPR()
        {
            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(MEMBEREPR$0, 0);
                if (target == null)
                {
                    return null;
                }
                return target;
            }
        }
        
        /**
         * Sets the "MemberEPR" element
         */
        public void setMemberEPR(org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType memberEPR)
        {
            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(MEMBEREPR$0, 0);
                if (target == null)
                {
                    target = (org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType)get_store().add_element_user(MEMBEREPR$0);
                }
                target.set(memberEPR);
            }
        }
        
        /**
         * Appends and returns a new empty "MemberEPR" element
         */
        public org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType addNewMemberEPR()
        {
            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(MEMBEREPR$0);
                return target;
            }
        }
        
        /**
         * Gets the "Content" element
         */
        public org.apache.xmlbeans.XmlObject getContent()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlObject target = null;
                target = (org.apache.xmlbeans.XmlObject)get_store().find_element_user(CONTENT$2, 0);
                if (target == null)
                {
                    return null;
                }
                return target;
            }
        }
        
        /**
         * Sets the "Content" element
         */
        public void setContent(org.apache.xmlbeans.XmlObject content)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlObject target = null;
                target = (org.apache.xmlbeans.XmlObject)get_store().find_element_user(CONTENT$2, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlObject)get_store().add_element_user(CONTENT$2);
                }
                target.set(content);
            }
        }
        
        /**
         * Appends and returns a new empty "Content" element
         */
        public org.apache.xmlbeans.XmlObject addNewContent()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlObject target = null;
                target = (org.apache.xmlbeans.XmlObject)get_store().add_element_user(CONTENT$2);
                return target;
            }
        }
        
        /**
         * Gets the "InitialTerminationTime" element
         */
        public java.util.Calendar getInitialTerminationTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INITIALTERMINATIONTIME$4, 0);
                if (target == null)
                {
                    return null;
                }
                return target.getCalendarValue();
            }
        }
        
        /**
         * Gets (as xml) the "InitialTerminationTime" element
         */
        public org.apache.xmlbeans.XmlDateTime xgetInitialTerminationTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlDateTime target = null;
                target = (org.apache.xmlbeans.XmlDateTime)get_store().find_element_user(INITIALTERMINATIONTIME$4, 0);
                return target;
            }
        }
        
        /**
         * True if has "InitialTerminationTime" element
         */
        public boolean isSetInitialTerminationTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(INITIALTERMINATIONTIME$4) != 0;
            }
        }
        
        /**
         * Sets the "InitialTerminationTime" element
         */
        public void setInitialTerminationTime(java.util.Calendar initialTerminationTime)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INITIALTERMINATIONTIME$4, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(INITIALTERMINATIONTIME$4);
                }
                target.setCalendarValue(initialTerminationTime);
            }
        }
        
        /**
         * Sets (as xml) the "InitialTerminationTime" element
         */
        public void xsetInitialTerminationTime(org.apache.xmlbeans.XmlDateTime initialTerminationTime)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlDateTime target = null;
                target = (org.apache.xmlbeans.XmlDateTime)get_store().find_element_user(INITIALTERMINATIONTIME$4, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlDateTime)get_store().add_element_user(INITIALTERMINATIONTIME$4);
                }
                target.set(initialTerminationTime);
            }
        }
        
        /**
         * Unsets the "InitialTerminationTime" element
         */
        public void unsetInitialTerminationTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(INITIALTERMINATIONTIME$4, 0);
            }
        }
    }
}
