/*
 * An XML document type.
 * Localname: Renew
 * Namespace: http://schemas.xmlsoap.org/ws/2004/08/eventing
 * Java type: org.activemq.ws.xmlbeans.eventing.RenewDocument
 *
 * Automatically generated - do not modify.
 */
package org.activemq.ws.xmlbeans.eventing.impl;
/**
 * A document containing one Renew(@http://schemas.xmlsoap.org/ws/2004/08/eventing) element.
 *
 * This is a complex type.
 */
public class RenewDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.eventing.RenewDocument
{
    
    public RenewDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName RENEW$0 = 
        new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/08/eventing", "Renew");
    
    
    /**
     * Gets the "Renew" element
     */
    public org.activemq.ws.xmlbeans.eventing.RenewDocument.Renew getRenew()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.eventing.RenewDocument.Renew target = null;
            target = (org.activemq.ws.xmlbeans.eventing.RenewDocument.Renew)get_store().find_element_user(RENEW$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "Renew" element
     */
    public void setRenew(org.activemq.ws.xmlbeans.eventing.RenewDocument.Renew renew)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.eventing.RenewDocument.Renew target = null;
            target = (org.activemq.ws.xmlbeans.eventing.RenewDocument.Renew)get_store().find_element_user(RENEW$0, 0);
            if (target == null)
            {
                target = (org.activemq.ws.xmlbeans.eventing.RenewDocument.Renew)get_store().add_element_user(RENEW$0);
            }
            target.set(renew);
        }
    }
    
    /**
     * Appends and returns a new empty "Renew" element
     */
    public org.activemq.ws.xmlbeans.eventing.RenewDocument.Renew addNewRenew()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.eventing.RenewDocument.Renew target = null;
            target = (org.activemq.ws.xmlbeans.eventing.RenewDocument.Renew)get_store().add_element_user(RENEW$0);
            return target;
        }
    }
    /**
     * An XML Renew(@http://schemas.xmlsoap.org/ws/2004/08/eventing).
     *
     * This is a complex type.
     */
    public static class RenewImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.eventing.RenewDocument.Renew
    {
        
        public RenewImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }
        
        private static final javax.xml.namespace.QName EXPIRES$0 = 
            new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/08/eventing", "Expires");
        
        
        /**
         * Gets the "Expires" element
         */
        public java.lang.Object getExpires()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(EXPIRES$0, 0);
                if (target == null)
                {
                    return null;
                }
                return target.getObjectValue();
            }
        }
        
        /**
         * Gets (as xml) the "Expires" element
         */
        public org.activemq.ws.xmlbeans.eventing.ExpirationType xgetExpires()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.eventing.ExpirationType target = null;
                target = (org.activemq.ws.xmlbeans.eventing.ExpirationType)get_store().find_element_user(EXPIRES$0, 0);
                return target;
            }
        }
        
        /**
         * True if has "Expires" element
         */
        public boolean isSetExpires()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(EXPIRES$0) != 0;
            }
        }
        
        /**
         * Sets the "Expires" element
         */
        public void setExpires(java.lang.Object expires)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(EXPIRES$0, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(EXPIRES$0);
                }
                target.setObjectValue(expires);
            }
        }
        
        /**
         * Sets (as xml) the "Expires" element
         */
        public void xsetExpires(org.activemq.ws.xmlbeans.eventing.ExpirationType expires)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.eventing.ExpirationType target = null;
                target = (org.activemq.ws.xmlbeans.eventing.ExpirationType)get_store().find_element_user(EXPIRES$0, 0);
                if (target == null)
                {
                    target = (org.activemq.ws.xmlbeans.eventing.ExpirationType)get_store().add_element_user(EXPIRES$0);
                }
                target.set(expires);
            }
        }
        
        /**
         * Unsets the "Expires" element
         */
        public void unsetExpires()
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(EXPIRES$0, 0);
            }
        }
    }
}
