/*
 * An XML document type.
 * Localname: PublisherRegistrationRP
 * Namespace: http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BrokeredNotification-1.2-draft-01.xsd
 * Java type: org.activemq.ws.xmlbeans.notification.brokered.PublisherRegistrationRPDocument
 *
 * Automatically generated - do not modify.
 */
package org.activemq.ws.xmlbeans.notification.brokered.impl;
/**
 * A document containing one PublisherRegistrationRP(@http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BrokeredNotification-1.2-draft-01.xsd) element.
 *
 * This is a complex type.
 */
public class PublisherRegistrationRPDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.notification.brokered.PublisherRegistrationRPDocument
{
    
    public PublisherRegistrationRPDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName PUBLISHERREGISTRATIONRP$0 = 
        new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BrokeredNotification-1.2-draft-01.xsd", "PublisherRegistrationRP");
    
    
    /**
     * Gets the "PublisherRegistrationRP" element
     */
    public org.activemq.ws.xmlbeans.notification.brokered.PublisherRegistrationRPDocument.PublisherRegistrationRP getPublisherRegistrationRP()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.notification.brokered.PublisherRegistrationRPDocument.PublisherRegistrationRP target = null;
            target = (org.activemq.ws.xmlbeans.notification.brokered.PublisherRegistrationRPDocument.PublisherRegistrationRP)get_store().find_element_user(PUBLISHERREGISTRATIONRP$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "PublisherRegistrationRP" element
     */
    public void setPublisherRegistrationRP(org.activemq.ws.xmlbeans.notification.brokered.PublisherRegistrationRPDocument.PublisherRegistrationRP publisherRegistrationRP)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.notification.brokered.PublisherRegistrationRPDocument.PublisherRegistrationRP target = null;
            target = (org.activemq.ws.xmlbeans.notification.brokered.PublisherRegistrationRPDocument.PublisherRegistrationRP)get_store().find_element_user(PUBLISHERREGISTRATIONRP$0, 0);
            if (target == null)
            {
                target = (org.activemq.ws.xmlbeans.notification.brokered.PublisherRegistrationRPDocument.PublisherRegistrationRP)get_store().add_element_user(PUBLISHERREGISTRATIONRP$0);
            }
            target.set(publisherRegistrationRP);
        }
    }
    
    /**
     * Appends and returns a new empty "PublisherRegistrationRP" element
     */
    public org.activemq.ws.xmlbeans.notification.brokered.PublisherRegistrationRPDocument.PublisherRegistrationRP addNewPublisherRegistrationRP()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.notification.brokered.PublisherRegistrationRPDocument.PublisherRegistrationRP target = null;
            target = (org.activemq.ws.xmlbeans.notification.brokered.PublisherRegistrationRPDocument.PublisherRegistrationRP)get_store().add_element_user(PUBLISHERREGISTRATIONRP$0);
            return target;
        }
    }
    /**
     * An XML PublisherRegistrationRP(@http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BrokeredNotification-1.2-draft-01.xsd).
     *
     * This is a complex type.
     */
    public static class PublisherRegistrationRPImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.notification.brokered.PublisherRegistrationRPDocument.PublisherRegistrationRP
    {
        
        public PublisherRegistrationRPImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }
        
        private static final javax.xml.namespace.QName CURRENTTIME$0 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd", "CurrentTime");
        private static final javax.xml.namespace.QName TERMINATIONTIME$2 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd", "TerminationTime");
        private static final javax.xml.namespace.QName PUBLISHERREFERENCE$4 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BrokeredNotification-1.2-draft-01.xsd", "PublisherReference");
        private static final javax.xml.namespace.QName TOPIC$6 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BrokeredNotification-1.2-draft-01.xsd", "Topic");
        private static final javax.xml.namespace.QName DEMAND$8 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BrokeredNotification-1.2-draft-01.xsd", "Demand");
        private static final javax.xml.namespace.QName CREATIONTIME$10 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BrokeredNotification-1.2-draft-01.xsd", "CreationTime");
        
        
        /**
         * Gets the "CurrentTime" element
         */
        public java.util.Calendar getCurrentTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(CURRENTTIME$0, 0);
                if (target == null)
                {
                    return null;
                }
                return target.getCalendarValue();
            }
        }
        
        /**
         * Gets (as xml) the "CurrentTime" element
         */
        public org.apache.xmlbeans.XmlDateTime xgetCurrentTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlDateTime target = null;
                target = (org.apache.xmlbeans.XmlDateTime)get_store().find_element_user(CURRENTTIME$0, 0);
                return target;
            }
        }
        
        /**
         * Sets the "CurrentTime" element
         */
        public void setCurrentTime(java.util.Calendar currentTime)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(CURRENTTIME$0, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(CURRENTTIME$0);
                }
                target.setCalendarValue(currentTime);
            }
        }
        
        /**
         * Sets (as xml) the "CurrentTime" element
         */
        public void xsetCurrentTime(org.apache.xmlbeans.XmlDateTime currentTime)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlDateTime target = null;
                target = (org.apache.xmlbeans.XmlDateTime)get_store().find_element_user(CURRENTTIME$0, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlDateTime)get_store().add_element_user(CURRENTTIME$0);
                }
                target.set(currentTime);
            }
        }
        
        /**
         * Gets the "TerminationTime" element
         */
        public java.util.Calendar getTerminationTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TERMINATIONTIME$2, 0);
                if (target == null)
                {
                    return null;
                }
                return target.getCalendarValue();
            }
        }
        
        /**
         * Gets (as xml) the "TerminationTime" element
         */
        public org.apache.xmlbeans.XmlDateTime xgetTerminationTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlDateTime target = null;
                target = (org.apache.xmlbeans.XmlDateTime)get_store().find_element_user(TERMINATIONTIME$2, 0);
                return target;
            }
        }
        
        /**
         * Tests for nil "TerminationTime" element
         */
        public boolean isNilTerminationTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlDateTime target = null;
                target = (org.apache.xmlbeans.XmlDateTime)get_store().find_element_user(TERMINATIONTIME$2, 0);
                if (target == null) return false;
                return target.isNil();
            }
        }
        
        /**
         * Sets the "TerminationTime" element
         */
        public void setTerminationTime(java.util.Calendar terminationTime)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TERMINATIONTIME$2, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(TERMINATIONTIME$2);
                }
                target.setCalendarValue(terminationTime);
            }
        }
        
        /**
         * Sets (as xml) the "TerminationTime" element
         */
        public void xsetTerminationTime(org.apache.xmlbeans.XmlDateTime terminationTime)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlDateTime target = null;
                target = (org.apache.xmlbeans.XmlDateTime)get_store().find_element_user(TERMINATIONTIME$2, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlDateTime)get_store().add_element_user(TERMINATIONTIME$2);
                }
                target.set(terminationTime);
            }
        }
        
        /**
         * Nils the "TerminationTime" element
         */
        public void setNilTerminationTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlDateTime target = null;
                target = (org.apache.xmlbeans.XmlDateTime)get_store().find_element_user(TERMINATIONTIME$2, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlDateTime)get_store().add_element_user(TERMINATIONTIME$2);
                }
                target.setNil();
            }
        }
        
        /**
         * Gets the "PublisherReference" element
         */
        public org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType getPublisherReference()
        {
            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(PUBLISHERREFERENCE$4, 0);
                if (target == null)
                {
                    return null;
                }
                return target;
            }
        }
        
        /**
         * True if has "PublisherReference" element
         */
        public boolean isSetPublisherReference()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(PUBLISHERREFERENCE$4) != 0;
            }
        }
        
        /**
         * Sets the "PublisherReference" element
         */
        public void setPublisherReference(org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType publisherReference)
        {
            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(PUBLISHERREFERENCE$4, 0);
                if (target == null)
                {
                    target = (org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType)get_store().add_element_user(PUBLISHERREFERENCE$4);
                }
                target.set(publisherReference);
            }
        }
        
        /**
         * Appends and returns a new empty "PublisherReference" element
         */
        public org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType addNewPublisherReference()
        {
            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(PUBLISHERREFERENCE$4);
                return target;
            }
        }
        
        /**
         * Unsets the "PublisherReference" element
         */
        public void unsetPublisherReference()
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(PUBLISHERREFERENCE$4, 0);
            }
        }
        
        /**
         * Gets array of all "Topic" elements
         */
        public org.activemq.ws.xmlbeans.notification.base.TopicExpressionType[] getTopicArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(TOPIC$6, targetList);
                org.activemq.ws.xmlbeans.notification.base.TopicExpressionType[] result = new org.activemq.ws.xmlbeans.notification.base.TopicExpressionType[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "Topic" element
         */
        public org.activemq.ws.xmlbeans.notification.base.TopicExpressionType getTopicArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.notification.base.TopicExpressionType target = null;
                target = (org.activemq.ws.xmlbeans.notification.base.TopicExpressionType)get_store().find_element_user(TOPIC$6, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "Topic" element
         */
        public int sizeOfTopicArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(TOPIC$6);
            }
        }
        
        /**
         * Sets array of all "Topic" element
         */
        public void setTopicArray(org.activemq.ws.xmlbeans.notification.base.TopicExpressionType[] topicArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(topicArray, TOPIC$6);
            }
        }
        
        /**
         * Sets ith "Topic" element
         */
        public void setTopicArray(int i, org.activemq.ws.xmlbeans.notification.base.TopicExpressionType topic)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.notification.base.TopicExpressionType target = null;
                target = (org.activemq.ws.xmlbeans.notification.base.TopicExpressionType)get_store().find_element_user(TOPIC$6, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(topic);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "Topic" element
         */
        public org.activemq.ws.xmlbeans.notification.base.TopicExpressionType insertNewTopic(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.notification.base.TopicExpressionType target = null;
                target = (org.activemq.ws.xmlbeans.notification.base.TopicExpressionType)get_store().insert_element_user(TOPIC$6, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "Topic" element
         */
        public org.activemq.ws.xmlbeans.notification.base.TopicExpressionType addNewTopic()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.notification.base.TopicExpressionType target = null;
                target = (org.activemq.ws.xmlbeans.notification.base.TopicExpressionType)get_store().add_element_user(TOPIC$6);
                return target;
            }
        }
        
        /**
         * Removes the ith "Topic" element
         */
        public void removeTopic(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(TOPIC$6, i);
            }
        }
        
        /**
         * Gets the "Demand" element
         */
        public boolean getDemand()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DEMAND$8, 0);
                if (target == null)
                {
                    return false;
                }
                return target.getBooleanValue();
            }
        }
        
        /**
         * Gets (as xml) the "Demand" element
         */
        public org.apache.xmlbeans.XmlBoolean xgetDemand()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlBoolean target = null;
                target = (org.apache.xmlbeans.XmlBoolean)get_store().find_element_user(DEMAND$8, 0);
                return target;
            }
        }
        
        /**
         * Sets the "Demand" element
         */
        public void setDemand(boolean demand)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DEMAND$8, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(DEMAND$8);
                }
                target.setBooleanValue(demand);
            }
        }
        
        /**
         * Sets (as xml) the "Demand" element
         */
        public void xsetDemand(org.apache.xmlbeans.XmlBoolean demand)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlBoolean target = null;
                target = (org.apache.xmlbeans.XmlBoolean)get_store().find_element_user(DEMAND$8, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlBoolean)get_store().add_element_user(DEMAND$8);
                }
                target.set(demand);
            }
        }
        
        /**
         * Gets the "CreationTime" element
         */
        public java.util.Calendar getCreationTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(CREATIONTIME$10, 0);
                if (target == null)
                {
                    return null;
                }
                return target.getCalendarValue();
            }
        }
        
        /**
         * Gets (as xml) the "CreationTime" element
         */
        public org.apache.xmlbeans.XmlDateTime xgetCreationTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlDateTime target = null;
                target = (org.apache.xmlbeans.XmlDateTime)get_store().find_element_user(CREATIONTIME$10, 0);
                return target;
            }
        }
        
        /**
         * True if has "CreationTime" element
         */
        public boolean isSetCreationTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(CREATIONTIME$10) != 0;
            }
        }
        
        /**
         * Sets the "CreationTime" element
         */
        public void setCreationTime(java.util.Calendar creationTime)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(CREATIONTIME$10, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(CREATIONTIME$10);
                }
                target.setCalendarValue(creationTime);
            }
        }
        
        /**
         * Sets (as xml) the "CreationTime" element
         */
        public void xsetCreationTime(org.apache.xmlbeans.XmlDateTime creationTime)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlDateTime target = null;
                target = (org.apache.xmlbeans.XmlDateTime)get_store().find_element_user(CREATIONTIME$10, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlDateTime)get_store().add_element_user(CREATIONTIME$10);
                }
                target.set(creationTime);
            }
        }
        
        /**
         * Unsets the "CreationTime" element
         */
        public void unsetCreationTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(CREATIONTIME$10, 0);
            }
        }
    }
}
