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

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

/*
 * An XML document type.
 * Localname: test-collection
 * Namespace: http://csrc.nist.gov/ns/metaschema/test-suite/1.0
 * Java type: gov.nist.secauto.metaschema.model.testing.xmlbeans.TestCollectionDocument
 *
 * 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-collection(@http://csrc.nist.gov/ns/metaschema/test-suite/1.0) element.
 *
 * This is a complex type.
 */
public class TestCollectionDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements gov.nist.secauto.metaschema.model.testing.xmlbeans.TestCollectionDocument {
    private static final long serialVersionUID = 1L;

    public TestCollectionDocumentImpl(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 the "test-collection" element
     */
    @Override
    public gov.nist.secauto.metaschema.model.testing.xmlbeans.TestCollectionDocument.TestCollection getTestCollection() {
        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], 0);
            return (target == null) ? null : target;
        }
    }

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

    /**
     * Appends and returns a new empty "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;
        }
    }
    /**
     * An XML test-collection(@http://csrc.nist.gov/ns/metaschema/test-suite/1.0).
     *
     * This is a complex type.
     */
    public static class TestCollectionImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements gov.nist.secauto.metaschema.model.testing.xmlbeans.TestCollectionDocument.TestCollection {
        private static final long serialVersionUID = 1L;

        public TestCollectionImpl(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-scenario"),
            new QName("", "location"),
            new QName("", "name"),
        };


        /**
         * Gets a List of "test-scenario" elements
         */
        @Override
        public java.util.List getTestScenarioList() {
            synchronized (monitor()) {
                check_orphaned();
                return new org.apache.xmlbeans.impl.values.JavaListXmlObject<>(
                    this::getTestScenarioArray,
                    this::setTestScenarioArray,
                    this::insertNewTestScenario,
                    this::removeTestScenario,
                    this::sizeOfTestScenarioArray
                );
            }
        }

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

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

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

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

        /**
         * Sets ith "test-scenario" element
         */
        @Override
        public void setTestScenarioArray(int i, gov.nist.secauto.metaschema.model.testing.xmlbeans.TestScenarioDocument.TestScenario testScenario) {
            generatedSetterHelperImpl(testScenario, 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-scenario" element
         */
        @Override
        public gov.nist.secauto.metaschema.model.testing.xmlbeans.TestScenarioDocument.TestScenario insertNewTestScenario(int i) {
            synchronized (monitor()) {
                check_orphaned();
                gov.nist.secauto.metaschema.model.testing.xmlbeans.TestScenarioDocument.TestScenario target = null;
                target = (gov.nist.secauto.metaschema.model.testing.xmlbeans.TestScenarioDocument.TestScenario)get_store().insert_element_user(PROPERTY_QNAME[0], i);
                return target;
            }
        }

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

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

        /**
         * Gets the "location" attribute
         */
        @Override
        public java.lang.String getLocation() {
            synchronized (monitor()) {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(PROPERTY_QNAME[1]);
                return (target == null) ? null : target.getStringValue();
            }
        }

        /**
         * Sets the "location" attribute
         */
        @Override
        public void setLocation(java.lang.String location) {
            synchronized (monitor()) {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(PROPERTY_QNAME[1]);
                if (target == null) {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(PROPERTY_QNAME[1]);
                }
                target.setStringValue(location);
            }
        }

        /**
         * Gets the "name" attribute
         */
        @Override
        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(PROPERTY_QNAME[2]);
                return (target == null) ? null : target.getStringValue();
            }
        }

        /**
         * Sets the "name" attribute
         */
        @Override
        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(PROPERTY_QNAME[2]);
                if (target == null) {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(PROPERTY_QNAME[2]);
                }
                target.setStringValue(name);
            }
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy