/*
 * An XML document type.
 * Localname: encryption-certificate
 * Namespace: http://www.bea.com/2003/03/wli/tpm
 * Java type: com.bea.x2003.x03.wli.tpm.EncryptionCertificateDocument
 *
 * Automatically generated - do not modify.
 */
package com.bea.x2003.x03.wli.tpm.impl;
/**
 * A document containing one encryption-certificate(@http://www.bea.com/2003/03/wli/tpm) element.
 *
 * This is a complex type.
 */
public class EncryptionCertificateDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.bea.x2003.x03.wli.tpm.EncryptionCertificateDocument
{
    
    public EncryptionCertificateDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName ENCRYPTIONCERTIFICATE$0 = 
        new javax.xml.namespace.QName("http://www.bea.com/2003/03/wli/tpm", "encryption-certificate");
    
    
    /**
     * Gets the "encryption-certificate" element
     */
    public com.bea.x2003.x03.wli.tpm.EncryptionCertificateDocument.EncryptionCertificate getEncryptionCertificate()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.bea.x2003.x03.wli.tpm.EncryptionCertificateDocument.EncryptionCertificate target = null;
            target = (com.bea.x2003.x03.wli.tpm.EncryptionCertificateDocument.EncryptionCertificate)get_store().find_element_user(ENCRYPTIONCERTIFICATE$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "encryption-certificate" element
     */
    public void setEncryptionCertificate(com.bea.x2003.x03.wli.tpm.EncryptionCertificateDocument.EncryptionCertificate encryptionCertificate)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.bea.x2003.x03.wli.tpm.EncryptionCertificateDocument.EncryptionCertificate target = null;
            target = (com.bea.x2003.x03.wli.tpm.EncryptionCertificateDocument.EncryptionCertificate)get_store().find_element_user(ENCRYPTIONCERTIFICATE$0, 0);
            if (target == null)
            {
                target = (com.bea.x2003.x03.wli.tpm.EncryptionCertificateDocument.EncryptionCertificate)get_store().add_element_user(ENCRYPTIONCERTIFICATE$0);
            }
            target.set(encryptionCertificate);
        }
    }
    
    /**
     * Appends and returns a new empty "encryption-certificate" element
     */
    public com.bea.x2003.x03.wli.tpm.EncryptionCertificateDocument.EncryptionCertificate addNewEncryptionCertificate()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.bea.x2003.x03.wli.tpm.EncryptionCertificateDocument.EncryptionCertificate target = null;
            target = (com.bea.x2003.x03.wli.tpm.EncryptionCertificateDocument.EncryptionCertificate)get_store().add_element_user(ENCRYPTIONCERTIFICATE$0);
            return target;
        }
    }
    /**
     * An XML encryption-certificate(@http://www.bea.com/2003/03/wli/tpm).
     *
     * This is a complex type.
     */
    public static class EncryptionCertificateImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.bea.x2003.x03.wli.tpm.EncryptionCertificateDocument.EncryptionCertificate
    {
        
        public EncryptionCertificateImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }
        
        private static final javax.xml.namespace.QName KEYINFO$0 = 
            new javax.xml.namespace.QName("http://www.w3.org/2000/09/xmldsig#", "KeyInfo");
        private static final javax.xml.namespace.QName NAME$2 = 
            new javax.xml.namespace.QName("", "name");
        private static final javax.xml.namespace.QName PASSWORDALIAS$4 = 
            new javax.xml.namespace.QName("", "password-alias");
        
        
        /**
         * Gets the "KeyInfo" element
         */
        public org.w3.x2000.x09.xmldsig.KeyInfoType getKeyInfo()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.w3.x2000.x09.xmldsig.KeyInfoType target = null;
                target = (org.w3.x2000.x09.xmldsig.KeyInfoType)get_store().find_element_user(KEYINFO$0, 0);
                if (target == null)
                {
                    return null;
                }
                return target;
            }
        }
        
        /**
         * True if has "KeyInfo" element
         */
        public boolean isSetKeyInfo()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(KEYINFO$0) != 0;
            }
        }
        
        /**
         * Sets the "KeyInfo" element
         */
        public void setKeyInfo(org.w3.x2000.x09.xmldsig.KeyInfoType keyInfo)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.w3.x2000.x09.xmldsig.KeyInfoType target = null;
                target = (org.w3.x2000.x09.xmldsig.KeyInfoType)get_store().find_element_user(KEYINFO$0, 0);
                if (target == null)
                {
                    target = (org.w3.x2000.x09.xmldsig.KeyInfoType)get_store().add_element_user(KEYINFO$0);
                }
                target.set(keyInfo);
            }
        }
        
        /**
         * Appends and returns a new empty "KeyInfo" element
         */
        public org.w3.x2000.x09.xmldsig.KeyInfoType addNewKeyInfo()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.w3.x2000.x09.xmldsig.KeyInfoType target = null;
                target = (org.w3.x2000.x09.xmldsig.KeyInfoType)get_store().add_element_user(KEYINFO$0);
                return target;
            }
        }
        
        /**
         * Unsets the "KeyInfo" element
         */
        public void unsetKeyInfo()
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(KEYINFO$0, 0);
            }
        }
        
        /**
         * Gets the "name" attribute
         */
        public java.lang.String getName()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(NAME$2);
                if (target == null)
                {
                    return null;
                }
                return target.getStringValue();
            }
        }
        
        /**
         * Gets (as xml) the "name" attribute
         */
        public org.apache.xmlbeans.XmlString xgetName()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlString target = null;
                target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(NAME$2);
                return target;
            }
        }
        
        /**
         * Sets the "name" attribute
         */
        public void setName(java.lang.String name)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(NAME$2);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(NAME$2);
                }
                target.setStringValue(name);
            }
        }
        
        /**
         * Sets (as xml) the "name" attribute
         */
        public void xsetName(org.apache.xmlbeans.XmlString name)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlString target = null;
                target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(NAME$2);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(NAME$2);
                }
                target.set(name);
            }
        }
        
        /**
         * Gets the "password-alias" attribute
         */
        public java.lang.String getPasswordAlias()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(PASSWORDALIAS$4);
                if (target == null)
                {
                    return null;
                }
                return target.getStringValue();
            }
        }
        
        /**
         * Gets (as xml) the "password-alias" attribute
         */
        public org.apache.xmlbeans.XmlString xgetPasswordAlias()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlString target = null;
                target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(PASSWORDALIAS$4);
                return target;
            }
        }
        
        /**
         * True if has "password-alias" attribute
         */
        public boolean isSetPasswordAlias()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().find_attribute_user(PASSWORDALIAS$4) != null;
            }
        }
        
        /**
         * Sets the "password-alias" attribute
         */
        public void setPasswordAlias(java.lang.String passwordAlias)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(PASSWORDALIAS$4);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(PASSWORDALIAS$4);
                }
                target.setStringValue(passwordAlias);
            }
        }
        
        /**
         * Sets (as xml) the "password-alias" attribute
         */
        public void xsetPasswordAlias(org.apache.xmlbeans.XmlString passwordAlias)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlString target = null;
                target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(PASSWORDALIAS$4);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(PASSWORDALIAS$4);
                }
                target.set(passwordAlias);
            }
        }
        
        /**
         * Unsets the "password-alias" attribute
         */
        public void unsetPasswordAlias()
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_attribute(PASSWORDALIAS$4);
            }
        }
    }
}
