Home » xmlbeans-2.5.0-src » org.apache.xmlbeans.samples » xquery » employees » impl » [javadoc | source]

    1   /*
    2    * An XML document type.
    3    * Localname: employees
    4    * Namespace: http://xmlbeans.apache.org/samples/xquery/employees
    5    * Java type: org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument
    6    *
    7    * Automatically generated - do not modify.
    8    */
    9   package org.apache.xmlbeans.samples.xquery.employees.impl;
   10   /**
   11    * A document containing one employees(@http://xmlbeans.apache.org/samples/xquery/employees) element.
   12    *
   13    * This is a complex type.
   14    */
   15   public class EmployeesDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument
   16   {
   17       
   18       public EmployeesDocumentImpl(org.apache.xmlbeans.SchemaType sType)
   19       {
   20           super(sType);
   21       }
   22       
   23       private static final javax.xml.namespace.QName EMPLOYEES$0 = 
   24           new javax.xml.namespace.QName("http://xmlbeans.apache.org/samples/xquery/employees", "employees");
   25       
   26       
   27       /**
   28        * Gets the "employees" element
   29        */
   30       public org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees getEmployees()
   31       {
   32           synchronized (monitor())
   33           {
   34               check_orphaned();
   35               org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees target = null;
   36               target = (org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees)get_store().find_element_user(EMPLOYEES$0, 0);
   37               if (target == null)
   38               {
   39                   return null;
   40               }
   41               return target;
   42           }
   43       }
   44       
   45       /**
   46        * Sets the "employees" element
   47        */
   48       public void setEmployees(org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees employees)
   49       {
   50           synchronized (monitor())
   51           {
   52               check_orphaned();
   53               org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees target = null;
   54               target = (org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees)get_store().find_element_user(EMPLOYEES$0, 0);
   55               if (target == null)
   56               {
   57                   target = (org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees)get_store().add_element_user(EMPLOYEES$0);
   58               }
   59               target.set(employees);
   60           }
   61       }
   62       
   63       /**
   64        * Appends and returns a new empty "employees" element
   65        */
   66       public org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees addNewEmployees()
   67       {
   68           synchronized (monitor())
   69           {
   70               check_orphaned();
   71               org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees target = null;
   72               target = (org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees)get_store().add_element_user(EMPLOYEES$0);
   73               return target;
   74           }
   75       }
   76       /**
   77        * An XML employees(@http://xmlbeans.apache.org/samples/xquery/employees).
   78        *
   79        * This is a complex type.
   80        */
   81       public static class EmployeesImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.apache.xmlbeans.samples.xquery.employees.EmployeesDocument.Employees
   82       {
   83           
   84           public EmployeesImpl(org.apache.xmlbeans.SchemaType sType)
   85           {
   86               super(sType);
   87           }
   88           
   89           private static final javax.xml.namespace.QName EMPLOYEE$0 = 
   90               new javax.xml.namespace.QName("http://xmlbeans.apache.org/samples/xquery/employees", "employee");
   91           
   92           
   93           /**
   94            * Gets array of all "employee" elements
   95            */
   96           public org.apache.xmlbeans.samples.xquery.employees.EmployeeType[] getEmployeeArray()
   97           {
   98               synchronized (monitor())
   99               {
  100                   check_orphaned();
  101                   java.util.List targetList = new java.util.ArrayList();
  102                   get_store().find_all_element_users(EMPLOYEE$0, targetList);
  103                   org.apache.xmlbeans.samples.xquery.employees.EmployeeType[] result = new org.apache.xmlbeans.samples.xquery.employees.EmployeeType[targetList.size()];
  104                   targetList.toArray(result);
  105                   return result;
  106               }
  107           }
  108           
  109           /**
  110            * Gets ith "employee" element
  111            */
  112           public org.apache.xmlbeans.samples.xquery.employees.EmployeeType getEmployeeArray(int i)
  113           {
  114               synchronized (monitor())
  115               {
  116                   check_orphaned();
  117                   org.apache.xmlbeans.samples.xquery.employees.EmployeeType target = null;
  118                   target = (org.apache.xmlbeans.samples.xquery.employees.EmployeeType)get_store().find_element_user(EMPLOYEE$0, i);
  119                   if (target == null)
  120                   {
  121                       throw new IndexOutOfBoundsException();
  122                   }
  123                   return target;
  124               }
  125           }
  126           
  127           /**
  128            * Returns number of "employee" element
  129            */
  130           public int sizeOfEmployeeArray()
  131           {
  132               synchronized (monitor())
  133               {
  134                   check_orphaned();
  135                   return get_store().count_elements(EMPLOYEE$0);
  136               }
  137           }
  138           
  139           /**
  140            * Sets array of all "employee" element
  141            */
  142           public void setEmployeeArray(org.apache.xmlbeans.samples.xquery.employees.EmployeeType[] employeeArray)
  143           {
  144               synchronized (monitor())
  145               {
  146                   check_orphaned();
  147                   arraySetterHelper(employeeArray, EMPLOYEE$0);
  148               }
  149           }
  150           
  151           /**
  152            * Sets ith "employee" element
  153            */
  154           public void setEmployeeArray(int i, org.apache.xmlbeans.samples.xquery.employees.EmployeeType employee)
  155           {
  156               synchronized (monitor())
  157               {
  158                   check_orphaned();
  159                   org.apache.xmlbeans.samples.xquery.employees.EmployeeType target = null;
  160                   target = (org.apache.xmlbeans.samples.xquery.employees.EmployeeType)get_store().find_element_user(EMPLOYEE$0, i);
  161                   if (target == null)
  162                   {
  163                       throw new IndexOutOfBoundsException();
  164                   }
  165                   target.set(employee);
  166               }
  167           }
  168           
  169           /**
  170            * Inserts and returns a new empty value (as xml) as the ith "employee" element
  171            */
  172           public org.apache.xmlbeans.samples.xquery.employees.EmployeeType insertNewEmployee(int i)
  173           {
  174               synchronized (monitor())
  175               {
  176                   check_orphaned();
  177                   org.apache.xmlbeans.samples.xquery.employees.EmployeeType target = null;
  178                   target = (org.apache.xmlbeans.samples.xquery.employees.EmployeeType)get_store().insert_element_user(EMPLOYEE$0, i);
  179                   return target;
  180               }
  181           }
  182           
  183           /**
  184            * Appends and returns a new empty value (as xml) as the last "employee" element
  185            */
  186           public org.apache.xmlbeans.samples.xquery.employees.EmployeeType addNewEmployee()
  187           {
  188               synchronized (monitor())
  189               {
  190                   check_orphaned();
  191                   org.apache.xmlbeans.samples.xquery.employees.EmployeeType target = null;
  192                   target = (org.apache.xmlbeans.samples.xquery.employees.EmployeeType)get_store().add_element_user(EMPLOYEE$0);
  193                   return target;
  194               }
  195           }
  196           
  197           /**
  198            * Removes the ith "employee" element
  199            */
  200           public void removeEmployee(int i)
  201           {
  202               synchronized (monitor())
  203               {
  204                   check_orphaned();
  205                   get_store().remove_element(EMPLOYEE$0, i);
  206               }
  207           }
  208       }
  209   }

Home » xmlbeans-2.5.0-src » org.apache.xmlbeans.samples » xquery » employees » impl » [javadoc | source]