All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gov.nist.secauto.metaschema.model.testing.xmlbeans.impl.TestSuiteDocumentImpl Maven / Gradle / Ivy

/*
 * An XML document type.
 * Localname: test-suite
 * Namespace: http://csrc.nist.gov/ns/metaschema/test-suite/1.0
 * Java type: gov.nist.secauto.metaschema.model.testing.xmlbeans.TestSuiteDocument
 *
 * Automatically generated - do not modify.
 */
package gov.nist.secauto.metaschema.model.testing.xmlbeans.impl;

import javax.xml.namespace.QName;
import org.apache.xmlbeans.QNameSet;
import org.apache.xmlbeans.XmlObject;

/**
 * A document containing one test-suite(@http://csrc.nist.gov/ns/metaschema/test-suite/1.0) element.
 *
 * This is a complex type.
 */
public class TestSuiteDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements gov.nist.secauto.metaschema.model.testing.xmlbeans.TestSuiteDocument {
    private static final long serialVersionUID = 1L;

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

    private static final QName[] PROPERTY_QNAME = {
        new QName("http://csrc.nist.gov/ns/metaschema/test-suite/1.0", "test-suite"),
    };


    /**
     * Gets the "test-suite" element
     */
    @Override
    public gov.nist.secauto.metaschema.model.testing.xmlbeans.TestSuiteDocument.TestSuite getTestSuite() {
        synchronized (monitor()) {
            check_orphaned();
            gov.nist.secauto.metaschema.model.testing.xmlbeans.TestSuiteDocument.TestSuite target = null;
            target = (gov.nist.secauto.metaschema.model.testing.xmlbeans.TestSuiteDocument.TestSuite)get_store().find_element_user(PROPERTY_QNAME[0], 0);
            return (target == null) ? null : target;
        }
    }

    /**
     * Sets the "test-suite" element
     */
    @Override
    public void setTestSuite(gov.nist.secauto.metaschema.model.testing.xmlbeans.TestSuiteDocument.TestSuite testSuite) {
        generatedSetterHelperImpl(testSuite, PROPERTY_QNAME[0], 0, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_SINGLETON);
    }

    /**
     * Appends and returns a new empty "test-suite" element
     */
    @Override
    public gov.nist.secauto.metaschema.model.testing.xmlbeans.TestSuiteDocument.TestSuite addNewTestSuite() {
        synchronized (monitor()) {
            check_orphaned();
            gov.nist.secauto.metaschema.model.testing.xmlbeans.TestSuiteDocument.TestSuite target = null;
            target = (gov.nist.secauto.metaschema.model.testing.xmlbeans.TestSuiteDocument.TestSuite)get_store().add_element_user(PROPERTY_QNAME[0]);
            return target;
        }
    }
    /**
     * An XML test-suite(@http://csrc.nist.gov/ns/metaschema/test-suite/1.0).
     *
     * This is a complex type.
     */
    public static class TestSuiteImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements gov.nist.secauto.metaschema.model.testing.xmlbeans.TestSuiteDocument.TestSuite {
        private static final long serialVersionUID = 1L;

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

        private static final QName[] PROPERTY_QNAME = {
            new QName("http://csrc.nist.gov/ns/metaschema/test-suite/1.0", "test-collection"),
        };


        /**
         * Gets a List of "test-collection" elements
         */
        @Override
        public java.util.List getTestCollectionList() {
            synchronized (monitor()) {
                check_orphaned();
                return new org.apache.xmlbeans.impl.values.JavaListXmlObject<>(
                    this::getTestCollectionArray,
                    this::setTestCollectionArray,
                    this::insertNewTestCollection,
                    this::removeTestCollection,
                    this::sizeOfTestCollectionArray
                );
            }
        }

        /**
         * Gets array of all "test-collection" elements
         */
        @Override
        public gov.nist.secauto.metaschema.model.testing.xmlbeans.TestCollectionDocument.TestCollection[] getTestCollectionArray() {
            return getXmlObjectArray(PROPERTY_QNAME[0], new gov.nist.secauto.metaschema.model.testing.xmlbeans.TestCollectionDocument.TestCollection[0]);
        }

        /**
         * Gets ith "test-collection" element
         */
        @Override
        public gov.nist.secauto.metaschema.model.testing.xmlbeans.TestCollectionDocument.TestCollection getTestCollectionArray(int i) {
            synchronized (monitor()) {
                check_orphaned();
                gov.nist.secauto.metaschema.model.testing.xmlbeans.TestCollectionDocument.TestCollection target = null;
                target = (gov.nist.secauto.metaschema.model.testing.xmlbeans.TestCollectionDocument.TestCollection)get_store().find_element_user(PROPERTY_QNAME[0], i);
                if (target == null) {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }

        /**
         * Returns number of "test-collection" element
         */
        @Override
        public int sizeOfTestCollectionArray() {
            synchronized (monitor()) {
                check_orphaned();
                return get_store().count_elements(PROPERTY_QNAME[0]);
            }
        }

        /**
         * Sets array of all "test-collection" element  WARNING: This method is not atomicaly synchronized.
         */
        @Override
        public void setTestCollectionArray(gov.nist.secauto.metaschema.model.testing.xmlbeans.TestCollectionDocument.TestCollection[] testCollectionArray) {
            check_orphaned();
            arraySetterHelper(testCollectionArray, PROPERTY_QNAME[0]);
        }

        /**
         * Sets ith "test-collection" element
         */
        @Override
        public void setTestCollectionArray(int i, gov.nist.secauto.metaschema.model.testing.xmlbeans.TestCollectionDocument.TestCollection testCollection) {
            generatedSetterHelperImpl(testCollection, PROPERTY_QNAME[0], i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        }

        /**
         * Inserts and returns a new empty value (as xml) as the ith "test-collection" element
         */
        @Override
        public gov.nist.secauto.metaschema.model.testing.xmlbeans.TestCollectionDocument.TestCollection insertNewTestCollection(int i) {
            synchronized (monitor()) {
                check_orphaned();
                gov.nist.secauto.metaschema.model.testing.xmlbeans.TestCollectionDocument.TestCollection target = null;
                target = (gov.nist.secauto.metaschema.model.testing.xmlbeans.TestCollectionDocument.TestCollection)get_store().insert_element_user(PROPERTY_QNAME[0], i);
                return target;
            }
        }

        /**
         * Appends and returns a new empty value (as xml) as the last "test-collection" element
         */
        @Override
        public gov.nist.secauto.metaschema.model.testing.xmlbeans.TestCollectionDocument.TestCollection addNewTestCollection() {
            synchronized (monitor()) {
                check_orphaned();
                gov.nist.secauto.metaschema.model.testing.xmlbeans.TestCollectionDocument.TestCollection target = null;
                target = (gov.nist.secauto.metaschema.model.testing.xmlbeans.TestCollectionDocument.TestCollection)get_store().add_element_user(PROPERTY_QNAME[0]);
                return target;
            }
        }

        /**
         * Removes the ith "test-collection" element
         */
        @Override
        public void removeTestCollection(int i) {
            synchronized (monitor()) {
                check_orphaned();
                get_store().remove_element(PROPERTY_QNAME[0], i);
            }
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy