/*
 * An XML document type.
 * Localname: SetTerminationTime
 * Namespace: http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd
 * Java type: org.activemq.ws.xmlbeans.resource.lifetime.SetTerminationTimeDocument
 *
 * Automatically generated - do not modify.
 */
package org.activemq.ws.xmlbeans.resource.lifetime.impl;
/**
 * A document containing one SetTerminationTime(@http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd) element.
 *
 * This is a complex type.
 */
public class SetTerminationTimeDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.resource.lifetime.SetTerminationTimeDocument
{
    
    public SetTerminationTimeDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName SETTERMINATIONTIME$0 = 
        new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd", "SetTerminationTime");
    
    
    /**
     * Gets the "SetTerminationTime" element
     */
    public org.activemq.ws.xmlbeans.resource.lifetime.SetTerminationTimeDocument.SetTerminationTime getSetTerminationTime()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.resource.lifetime.SetTerminationTimeDocument.SetTerminationTime target = null;
            target = (org.activemq.ws.xmlbeans.resource.lifetime.SetTerminationTimeDocument.SetTerminationTime)get_store().find_element_user(SETTERMINATIONTIME$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "SetTerminationTime" element
     */
    public void setSetTerminationTime(org.activemq.ws.xmlbeans.resource.lifetime.SetTerminationTimeDocument.SetTerminationTime setTerminationTime)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.resource.lifetime.SetTerminationTimeDocument.SetTerminationTime target = null;
            target = (org.activemq.ws.xmlbeans.resource.lifetime.SetTerminationTimeDocument.SetTerminationTime)get_store().find_element_user(SETTERMINATIONTIME$0, 0);
            if (target == null)
            {
                target = (org.activemq.ws.xmlbeans.resource.lifetime.SetTerminationTimeDocument.SetTerminationTime)get_store().add_element_user(SETTERMINATIONTIME$0);
            }
            target.set(setTerminationTime);
        }
    }
    
    /**
     * Appends and returns a new empty "SetTerminationTime" element
     */
    public org.activemq.ws.xmlbeans.resource.lifetime.SetTerminationTimeDocument.SetTerminationTime addNewSetTerminationTime()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.resource.lifetime.SetTerminationTimeDocument.SetTerminationTime target = null;
            target = (org.activemq.ws.xmlbeans.resource.lifetime.SetTerminationTimeDocument.SetTerminationTime)get_store().add_element_user(SETTERMINATIONTIME$0);
            return target;
        }
    }
    /**
     * An XML SetTerminationTime(@http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd).
     *
     * This is a complex type.
     */
    public static class SetTerminationTimeImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.resource.lifetime.SetTerminationTimeDocument.SetTerminationTime
    {
        
        public SetTerminationTimeImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }
        
        private static final javax.xml.namespace.QName REQUESTEDTERMINATIONTIME$0 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd", "RequestedTerminationTime");
        
        
        /**
         * Gets the "RequestedTerminationTime" element
         */
        public java.util.Calendar getRequestedTerminationTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(REQUESTEDTERMINATIONTIME$0, 0);
                if (target == null)
                {
                    return null;
                }
                return target.getCalendarValue();
            }
        }
        
        /**
         * Gets (as xml) the "RequestedTerminationTime" element
         */
        public org.apache.xmlbeans.XmlDateTime xgetRequestedTerminationTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlDateTime target = null;
                target = (org.apache.xmlbeans.XmlDateTime)get_store().find_element_user(REQUESTEDTERMINATIONTIME$0, 0);
                return target;
            }
        }
        
        /**
         * Tests for nil "RequestedTerminationTime" element
         */
        public boolean isNilRequestedTerminationTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlDateTime target = null;
                target = (org.apache.xmlbeans.XmlDateTime)get_store().find_element_user(REQUESTEDTERMINATIONTIME$0, 0);
                if (target == null) return false;
                return target.isNil();
            }
        }
        
        /**
         * Sets the "RequestedTerminationTime" element
         */
        public void setRequestedTerminationTime(java.util.Calendar requestedTerminationTime)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(REQUESTEDTERMINATIONTIME$0, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(REQUESTEDTERMINATIONTIME$0);
                }
                target.setCalendarValue(requestedTerminationTime);
            }
        }
        
        /**
         * Sets (as xml) the "RequestedTerminationTime" element
         */
        public void xsetRequestedTerminationTime(org.apache.xmlbeans.XmlDateTime requestedTerminationTime)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlDateTime target = null;
                target = (org.apache.xmlbeans.XmlDateTime)get_store().find_element_user(REQUESTEDTERMINATIONTIME$0, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlDateTime)get_store().add_element_user(REQUESTEDTERMINATIONTIME$0);
                }
                target.set(requestedTerminationTime);
            }
        }
        
        /**
         * Nils the "RequestedTerminationTime" element
         */
        public void setNilRequestedTerminationTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlDateTime target = null;
                target = (org.apache.xmlbeans.XmlDateTime)get_store().find_element_user(REQUESTEDTERMINATIONTIME$0, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlDateTime)get_store().add_element_user(REQUESTEDTERMINATIONTIME$0);
                }
                target.setNil();
            }
        }
    }
}
