/*
 * XML Type:  NotificationMessageHolderType
 * Namespace: http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd
 * Java type: org.activemq.ws.xmlbeans.notification.base.NotificationMessageHolderType
 *
 * Automatically generated - do not modify.
 */
package org.activemq.ws.xmlbeans.notification.base.impl;
/**
 * An XML NotificationMessageHolderType(@http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd).
 *
 * This is a complex type.
 */
public class NotificationMessageHolderTypeImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.notification.base.NotificationMessageHolderType
{
    
    public NotificationMessageHolderTypeImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName TOPIC$0 = 
        new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "Topic");
    private static final javax.xml.namespace.QName PRODUCERREFERENCE$2 = 
        new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "ProducerReference");
    private static final javax.xml.namespace.QName MESSAGE$4 = 
        new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "Message");
    
    
    /**
     * Gets the "Topic" element
     */
    public org.activemq.ws.xmlbeans.notification.base.TopicExpressionType getTopic()
    {
        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$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "Topic" element
     */
    public void setTopic(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$0, 0);
            if (target == null)
            {
                target = (org.activemq.ws.xmlbeans.notification.base.TopicExpressionType)get_store().add_element_user(TOPIC$0);
            }
            target.set(topic);
        }
    }
    
    /**
     * Appends and returns a new empty "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$0);
            return target;
        }
    }
    
    /**
     * Gets the "ProducerReference" element
     */
    public org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType getProducerReference()
    {
        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(PRODUCERREFERENCE$2, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "ProducerReference" element
     */
    public boolean isSetProducerReference()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(PRODUCERREFERENCE$2) != 0;
        }
    }
    
    /**
     * Sets the "ProducerReference" element
     */
    public void setProducerReference(org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType producerReference)
    {
        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(PRODUCERREFERENCE$2, 0);
            if (target == null)
            {
                target = (org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType)get_store().add_element_user(PRODUCERREFERENCE$2);
            }
            target.set(producerReference);
        }
    }
    
    /**
     * Appends and returns a new empty "ProducerReference" element
     */
    public org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType addNewProducerReference()
    {
        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(PRODUCERREFERENCE$2);
            return target;
        }
    }
    
    /**
     * Unsets the "ProducerReference" element
     */
    public void unsetProducerReference()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(PRODUCERREFERENCE$2, 0);
        }
    }
    
    /**
     * Gets the "Message" element
     */
    public org.apache.xmlbeans.XmlObject getMessage()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlObject target = null;
            target = (org.apache.xmlbeans.XmlObject)get_store().find_element_user(MESSAGE$4, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "Message" element
     */
    public void setMessage(org.apache.xmlbeans.XmlObject message)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlObject target = null;
            target = (org.apache.xmlbeans.XmlObject)get_store().find_element_user(MESSAGE$4, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlObject)get_store().add_element_user(MESSAGE$4);
            }
            target.set(message);
        }
    }
    
    /**
     * Appends and returns a new empty "Message" element
     */
    public org.apache.xmlbeans.XmlObject addNewMessage()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlObject target = null;
            target = (org.apache.xmlbeans.XmlObject)get_store().add_element_user(MESSAGE$4);
            return target;
        }
    }
}
