/*
 * An XML document type.
 * Localname: Subscribe
 * Namespace: http://schemas.xmlsoap.org/ws/2004/08/eventing
 * Java type: org.codehaus.activemq.ws.schema.eventing.SubscribeDocument
 *
 * Automatically generated - do not modify.
 */
package org.codehaus.activemq.ws.schema.eventing.impl;

/**
 * A document containing one Subscribe(@http://schemas.xmlsoap.org/ws/2004/08/eventing) element.
 * <p/>
 * This is a complex type.
 */
public class SubscribeDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.codehaus.activemq.ws.schema.eventing.SubscribeDocument {

    public SubscribeDocumentImpl(org.apache.xmlbeans.SchemaType sType) {
        super(sType);
    }

    private static final javax.xml.namespace.QName SUBSCRIBE$0 =
            new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/08/eventing", "Subscribe");


    /**
     * Gets the "Subscribe" element
     */
    public org.codehaus.activemq.ws.schema.eventing.SubscribeDocument.Subscribe getSubscribe() {
        synchronized (monitor()) {
            check_orphaned();
            org.codehaus.activemq.ws.schema.eventing.SubscribeDocument.Subscribe target = null;
            target = (org.codehaus.activemq.ws.schema.eventing.SubscribeDocument.Subscribe) get_store().find_element_user(SUBSCRIBE$0, 0);
            if (target == null) {
                return null;
            }
            return target;
        }
    }

    /**
     * Sets the "Subscribe" element
     */
    public void setSubscribe(org.codehaus.activemq.ws.schema.eventing.SubscribeDocument.Subscribe subscribe) {
        synchronized (monitor()) {
            check_orphaned();
            org.codehaus.activemq.ws.schema.eventing.SubscribeDocument.Subscribe target = null;
            target = (org.codehaus.activemq.ws.schema.eventing.SubscribeDocument.Subscribe) get_store().find_element_user(SUBSCRIBE$0, 0);
            if (target == null) {
                target = (org.codehaus.activemq.ws.schema.eventing.SubscribeDocument.Subscribe) get_store().add_element_user(SUBSCRIBE$0);
            }
            target.set(subscribe);
        }
    }

    /**
     * Appends and returns a new empty "Subscribe" element
     */
    public org.codehaus.activemq.ws.schema.eventing.SubscribeDocument.Subscribe addNewSubscribe() {
        synchronized (monitor()) {
            check_orphaned();
            org.codehaus.activemq.ws.schema.eventing.SubscribeDocument.Subscribe target = null;
            target = (org.codehaus.activemq.ws.schema.eventing.SubscribeDocument.Subscribe) get_store().add_element_user(SUBSCRIBE$0);
            return target;
        }
    }

    /**
     * An XML Subscribe(@http://schemas.xmlsoap.org/ws/2004/08/eventing).
     * <p/>
     * This is a complex type.
     */
    public static class SubscribeImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.codehaus.activemq.ws.schema.eventing.SubscribeDocument.Subscribe {

        public SubscribeImpl(org.apache.xmlbeans.SchemaType sType) {
            super(sType);
        }

        private static final javax.xml.namespace.QName ENDTO$0 =
                new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/08/eventing", "EndTo");
        private static final javax.xml.namespace.QName DELIVERY$2 =
                new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/08/eventing", "Delivery");
        private static final javax.xml.namespace.QName EXPIRES$4 =
                new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/08/eventing", "Expires");
        private static final javax.xml.namespace.QName FILTER$6 =
                new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/08/eventing", "Filter");


        /**
         * Gets the "EndTo" element
         */
        public org.codehaus.activemq.ws.schema.addressing.EndpointReferenceType getEndTo() {
            synchronized (monitor()) {
                check_orphaned();
                org.codehaus.activemq.ws.schema.addressing.EndpointReferenceType target = null;
                target = (org.codehaus.activemq.ws.schema.addressing.EndpointReferenceType) get_store().find_element_user(ENDTO$0, 0);
                if (target == null) {
                    return null;
                }
                return target;
            }
        }

        /**
         * True if has "EndTo" element
         */
        public boolean isSetEndTo() {
            synchronized (monitor()) {
                check_orphaned();
                return get_store().count_elements(ENDTO$0) != 0;
            }
        }

        /**
         * Sets the "EndTo" element
         */
        public void setEndTo(org.codehaus.activemq.ws.schema.addressing.EndpointReferenceType endTo) {
            synchronized (monitor()) {
                check_orphaned();
                org.codehaus.activemq.ws.schema.addressing.EndpointReferenceType target = null;
                target = (org.codehaus.activemq.ws.schema.addressing.EndpointReferenceType) get_store().find_element_user(ENDTO$0, 0);
                if (target == null) {
                    target = (org.codehaus.activemq.ws.schema.addressing.EndpointReferenceType) get_store().add_element_user(ENDTO$0);
                }
                target.set(endTo);
            }
        }

        /**
         * Appends and returns a new empty "EndTo" element
         */
        public org.codehaus.activemq.ws.schema.addressing.EndpointReferenceType addNewEndTo() {
            synchronized (monitor()) {
                check_orphaned();
                org.codehaus.activemq.ws.schema.addressing.EndpointReferenceType target = null;
                target = (org.codehaus.activemq.ws.schema.addressing.EndpointReferenceType) get_store().add_element_user(ENDTO$0);
                return target;
            }
        }

        /**
         * Unsets the "EndTo" element
         */
        public void unsetEndTo() {
            synchronized (monitor()) {
                check_orphaned();
                get_store().remove_element(ENDTO$0, 0);
            }
        }

        /**
         * Gets the "Delivery" element
         */
        public org.codehaus.activemq.ws.schema.eventing.DeliveryType getDelivery() {
            synchronized (monitor()) {
                check_orphaned();
                org.codehaus.activemq.ws.schema.eventing.DeliveryType target = null;
                target = (org.codehaus.activemq.ws.schema.eventing.DeliveryType) get_store().find_element_user(DELIVERY$2, 0);
                if (target == null) {
                    return null;
                }
                return target;
            }
        }

        /**
         * Sets the "Delivery" element
         */
        public void setDelivery(org.codehaus.activemq.ws.schema.eventing.DeliveryType delivery) {
            synchronized (monitor()) {
                check_orphaned();
                org.codehaus.activemq.ws.schema.eventing.DeliveryType target = null;
                target = (org.codehaus.activemq.ws.schema.eventing.DeliveryType) get_store().find_element_user(DELIVERY$2, 0);
                if (target == null) {
                    target = (org.codehaus.activemq.ws.schema.eventing.DeliveryType) get_store().add_element_user(DELIVERY$2);
                }
                target.set(delivery);
            }
        }

        /**
         * Appends and returns a new empty "Delivery" element
         */
        public org.codehaus.activemq.ws.schema.eventing.DeliveryType addNewDelivery() {
            synchronized (monitor()) {
                check_orphaned();
                org.codehaus.activemq.ws.schema.eventing.DeliveryType target = null;
                target = (org.codehaus.activemq.ws.schema.eventing.DeliveryType) get_store().add_element_user(DELIVERY$2);
                return target;
            }
        }

        /**
         * 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$4, 0);
                if (target == null) {
                    return null;
                }
                return target.getObjectValue();
            }
        }

        /**
         * Gets (as xml) the "Expires" element
         */
        public org.codehaus.activemq.ws.schema.eventing.ExpirationType xgetExpires() {
            synchronized (monitor()) {
                check_orphaned();
                org.codehaus.activemq.ws.schema.eventing.ExpirationType target = null;
                target = (org.codehaus.activemq.ws.schema.eventing.ExpirationType) get_store().find_element_user(EXPIRES$4, 0);
                return target;
            }
        }

        /**
         * True if has "Expires" element
         */
        public boolean isSetExpires() {
            synchronized (monitor()) {
                check_orphaned();
                return get_store().count_elements(EXPIRES$4) != 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$4, 0);
                if (target == null) {
                    target = (org.apache.xmlbeans.SimpleValue) get_store().add_element_user(EXPIRES$4);
                }
                target.setObjectValue(expires);
            }
        }

        /**
         * Sets (as xml) the "Expires" element
         */
        public void xsetExpires(org.codehaus.activemq.ws.schema.eventing.ExpirationType expires) {
            synchronized (monitor()) {
                check_orphaned();
                org.codehaus.activemq.ws.schema.eventing.ExpirationType target = null;
                target = (org.codehaus.activemq.ws.schema.eventing.ExpirationType) get_store().find_element_user(EXPIRES$4, 0);
                if (target == null) {
                    target = (org.codehaus.activemq.ws.schema.eventing.ExpirationType) get_store().add_element_user(EXPIRES$4);
                }
                target.set(expires);
            }
        }

        /**
         * Unsets the "Expires" element
         */
        public void unsetExpires() {
            synchronized (monitor()) {
                check_orphaned();
                get_store().remove_element(EXPIRES$4, 0);
            }
        }

        /**
         * Gets the "Filter" element
         */
        public org.codehaus.activemq.ws.schema.eventing.FilterType getFilter() {
            synchronized (monitor()) {
                check_orphaned();
                org.codehaus.activemq.ws.schema.eventing.FilterType target = null;
                target = (org.codehaus.activemq.ws.schema.eventing.FilterType) get_store().find_element_user(FILTER$6, 0);
                if (target == null) {
                    return null;
                }
                return target;
            }
        }

        /**
         * True if has "Filter" element
         */
        public boolean isSetFilter() {
            synchronized (monitor()) {
                check_orphaned();
                return get_store().count_elements(FILTER$6) != 0;
            }
        }

        /**
         * Sets the "Filter" element
         */
        public void setFilter(org.codehaus.activemq.ws.schema.eventing.FilterType filter) {
            synchronized (monitor()) {
                check_orphaned();
                org.codehaus.activemq.ws.schema.eventing.FilterType target = null;
                target = (org.codehaus.activemq.ws.schema.eventing.FilterType) get_store().find_element_user(FILTER$6, 0);
                if (target == null) {
                    target = (org.codehaus.activemq.ws.schema.eventing.FilterType) get_store().add_element_user(FILTER$6);
                }
                target.set(filter);
            }
        }

        /**
         * Appends and returns a new empty "Filter" element
         */
        public org.codehaus.activemq.ws.schema.eventing.FilterType addNewFilter() {
            synchronized (monitor()) {
                check_orphaned();
                org.codehaus.activemq.ws.schema.eventing.FilterType target = null;
                target = (org.codehaus.activemq.ws.schema.eventing.FilterType) get_store().add_element_user(FILTER$6);
                return target;
            }
        }

        /**
         * Unsets the "Filter" element
         */
        public void unsetFilter() {
            synchronized (monitor()) {
                check_orphaned();
                get_store().remove_element(FILTER$6, 0);
            }
        }
    }
}
