/*
 * An XML document type.
 * Localname: Precondition
 * 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.PreconditionDocument
 *
 * Automatically generated - do not modify.
 */
package org.activemq.ws.xmlbeans.notification.base.impl;
/**
 * A document containing one Precondition(@http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd) element.
 *
 * This is a complex type.
 */
public class PreconditionDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.notification.base.PreconditionDocument
{
    
    public PreconditionDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName PRECONDITION$0 = 
        new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "Precondition");
    
    
    /**
     * Gets the "Precondition" element
     */
    public org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType getPrecondition()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType target = null;
            target = (org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType)get_store().find_element_user(PRECONDITION$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "Precondition" element
     */
    public void setPrecondition(org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType precondition)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType target = null;
            target = (org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType)get_store().find_element_user(PRECONDITION$0, 0);
            if (target == null)
            {
                target = (org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType)get_store().add_element_user(PRECONDITION$0);
            }
            target.set(precondition);
        }
    }
    
    /**
     * Appends and returns a new empty "Precondition" element
     */
    public org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType addNewPrecondition()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType target = null;
            target = (org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType)get_store().add_element_user(PRECONDITION$0);
            return target;
        }
    }
}
