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

    1   /*
    2    * XML Type:  employeeType
    3    * Namespace: http://xmlbeans.apache.org/samples/xquery/employees
    4    * Java type: org.apache.xmlbeans.samples.xquery.employees.EmployeeType
    5    *
    6    * Automatically generated - do not modify.
    7    */
    8   package org.apache.xmlbeans.samples.xquery.employees.impl;
    9   /**
   10    * An XML employeeType(@http://xmlbeans.apache.org/samples/xquery/employees).
   11    *
   12    * This is a complex type.
   13    */
   14   public class EmployeeTypeImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.apache.xmlbeans.samples.xquery.employees.EmployeeType
   15   {
   16       
   17       public EmployeeTypeImpl(org.apache.xmlbeans.SchemaType sType)
   18       {
   19           super(sType);
   20       }
   21       
   22       private static final javax.xml.namespace.QName NAME$0 = 
   23           new javax.xml.namespace.QName("http://xmlbeans.apache.org/samples/xquery/employees", "name");
   24       private static final javax.xml.namespace.QName ADDRESS$2 = 
   25           new javax.xml.namespace.QName("http://xmlbeans.apache.org/samples/xquery/employees", "address");
   26       private static final javax.xml.namespace.QName PHONE$4 = 
   27           new javax.xml.namespace.QName("http://xmlbeans.apache.org/samples/xquery/employees", "phone");
   28       
   29       
   30       /**
   31        * Gets the "name" element
   32        */
   33       public java.lang.String getName()
   34       {
   35           synchronized (monitor())
   36           {
   37               check_orphaned();
   38               org.apache.xmlbeans.SimpleValue target = null;
   39               target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(NAME$0, 0);
   40               if (target == null)
   41               {
   42                   return null;
   43               }
   44               return target.getStringValue();
   45           }
   46       }
   47       
   48       /**
   49        * Gets (as xml) the "name" element
   50        */
   51       public org.apache.xmlbeans.XmlString xgetName()
   52       {
   53           synchronized (monitor())
   54           {
   55               check_orphaned();
   56               org.apache.xmlbeans.XmlString target = null;
   57               target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(NAME$0, 0);
   58               return target;
   59           }
   60       }
   61       
   62       /**
   63        * Sets the "name" element
   64        */
   65       public void setName(java.lang.String name)
   66       {
   67           synchronized (monitor())
   68           {
   69               check_orphaned();
   70               org.apache.xmlbeans.SimpleValue target = null;
   71               target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(NAME$0, 0);
   72               if (target == null)
   73               {
   74                   target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(NAME$0);
   75               }
   76               target.setStringValue(name);
   77           }
   78       }
   79       
   80       /**
   81        * Sets (as xml) the "name" element
   82        */
   83       public void xsetName(org.apache.xmlbeans.XmlString name)
   84       {
   85           synchronized (monitor())
   86           {
   87               check_orphaned();
   88               org.apache.xmlbeans.XmlString target = null;
   89               target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(NAME$0, 0);
   90               if (target == null)
   91               {
   92                   target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(NAME$0);
   93               }
   94               target.set(name);
   95           }
   96       }
   97       
   98       /**
   99        * Gets array of all "address" elements
  100        */
  101       public org.apache.xmlbeans.samples.xquery.employees.AddressType[] getAddressArray()
  102       {
  103           synchronized (monitor())
  104           {
  105               check_orphaned();
  106               java.util.List targetList = new java.util.ArrayList();
  107               get_store().find_all_element_users(ADDRESS$2, targetList);
  108               org.apache.xmlbeans.samples.xquery.employees.AddressType[] result = new org.apache.xmlbeans.samples.xquery.employees.AddressType[targetList.size()];
  109               targetList.toArray(result);
  110               return result;
  111           }
  112       }
  113       
  114       /**
  115        * Gets ith "address" element
  116        */
  117       public org.apache.xmlbeans.samples.xquery.employees.AddressType getAddressArray(int i)
  118       {
  119           synchronized (monitor())
  120           {
  121               check_orphaned();
  122               org.apache.xmlbeans.samples.xquery.employees.AddressType target = null;
  123               target = (org.apache.xmlbeans.samples.xquery.employees.AddressType)get_store().find_element_user(ADDRESS$2, i);
  124               if (target == null)
  125               {
  126                   throw new IndexOutOfBoundsException();
  127               }
  128               return target;
  129           }
  130       }
  131       
  132       /**
  133        * Returns number of "address" element
  134        */
  135       public int sizeOfAddressArray()
  136       {
  137           synchronized (monitor())
  138           {
  139               check_orphaned();
  140               return get_store().count_elements(ADDRESS$2);
  141           }
  142       }
  143       
  144       /**
  145        * Sets array of all "address" element
  146        */
  147       public void setAddressArray(org.apache.xmlbeans.samples.xquery.employees.AddressType[] addressArray)
  148       {
  149           synchronized (monitor())
  150           {
  151               check_orphaned();
  152               arraySetterHelper(addressArray, ADDRESS$2);
  153           }
  154       }
  155       
  156       /**
  157        * Sets ith "address" element
  158        */
  159       public void setAddressArray(int i, org.apache.xmlbeans.samples.xquery.employees.AddressType address)
  160       {
  161           synchronized (monitor())
  162           {
  163               check_orphaned();
  164               org.apache.xmlbeans.samples.xquery.employees.AddressType target = null;
  165               target = (org.apache.xmlbeans.samples.xquery.employees.AddressType)get_store().find_element_user(ADDRESS$2, i);
  166               if (target == null)
  167               {
  168                   throw new IndexOutOfBoundsException();
  169               }
  170               target.set(address);
  171           }
  172       }
  173       
  174       /**
  175        * Inserts and returns a new empty value (as xml) as the ith "address" element
  176        */
  177       public org.apache.xmlbeans.samples.xquery.employees.AddressType insertNewAddress(int i)
  178       {
  179           synchronized (monitor())
  180           {
  181               check_orphaned();
  182               org.apache.xmlbeans.samples.xquery.employees.AddressType target = null;
  183               target = (org.apache.xmlbeans.samples.xquery.employees.AddressType)get_store().insert_element_user(ADDRESS$2, i);
  184               return target;
  185           }
  186       }
  187       
  188       /**
  189        * Appends and returns a new empty value (as xml) as the last "address" element
  190        */
  191       public org.apache.xmlbeans.samples.xquery.employees.AddressType addNewAddress()
  192       {
  193           synchronized (monitor())
  194           {
  195               check_orphaned();
  196               org.apache.xmlbeans.samples.xquery.employees.AddressType target = null;
  197               target = (org.apache.xmlbeans.samples.xquery.employees.AddressType)get_store().add_element_user(ADDRESS$2);
  198               return target;
  199           }
  200       }
  201       
  202       /**
  203        * Removes the ith "address" element
  204        */
  205       public void removeAddress(int i)
  206       {
  207           synchronized (monitor())
  208           {
  209               check_orphaned();
  210               get_store().remove_element(ADDRESS$2, i);
  211           }
  212       }
  213       
  214       /**
  215        * Gets array of all "phone" elements
  216        */
  217       public org.apache.xmlbeans.samples.xquery.employees.PhoneType[] getPhoneArray()
  218       {
  219           synchronized (monitor())
  220           {
  221               check_orphaned();
  222               java.util.List targetList = new java.util.ArrayList();
  223               get_store().find_all_element_users(PHONE$4, targetList);
  224               org.apache.xmlbeans.samples.xquery.employees.PhoneType[] result = new org.apache.xmlbeans.samples.xquery.employees.PhoneType[targetList.size()];
  225               targetList.toArray(result);
  226               return result;
  227           }
  228       }
  229       
  230       /**
  231        * Gets ith "phone" element
  232        */
  233       public org.apache.xmlbeans.samples.xquery.employees.PhoneType getPhoneArray(int i)
  234       {
  235           synchronized (monitor())
  236           {
  237               check_orphaned();
  238               org.apache.xmlbeans.samples.xquery.employees.PhoneType target = null;
  239               target = (org.apache.xmlbeans.samples.xquery.employees.PhoneType)get_store().find_element_user(PHONE$4, i);
  240               if (target == null)
  241               {
  242                   throw new IndexOutOfBoundsException();
  243               }
  244               return target;
  245           }
  246       }
  247       
  248       /**
  249        * Returns number of "phone" element
  250        */
  251       public int sizeOfPhoneArray()
  252       {
  253           synchronized (monitor())
  254           {
  255               check_orphaned();
  256               return get_store().count_elements(PHONE$4);
  257           }
  258       }
  259       
  260       /**
  261        * Sets array of all "phone" element
  262        */
  263       public void setPhoneArray(org.apache.xmlbeans.samples.xquery.employees.PhoneType[] phoneArray)
  264       {
  265           synchronized (monitor())
  266           {
  267               check_orphaned();
  268               arraySetterHelper(phoneArray, PHONE$4);
  269           }
  270       }
  271       
  272       /**
  273        * Sets ith "phone" element
  274        */
  275       public void setPhoneArray(int i, org.apache.xmlbeans.samples.xquery.employees.PhoneType phone)
  276       {
  277           synchronized (monitor())
  278           {
  279               check_orphaned();
  280               org.apache.xmlbeans.samples.xquery.employees.PhoneType target = null;
  281               target = (org.apache.xmlbeans.samples.xquery.employees.PhoneType)get_store().find_element_user(PHONE$4, i);
  282               if (target == null)
  283               {
  284                   throw new IndexOutOfBoundsException();
  285               }
  286               target.set(phone);
  287           }
  288       }
  289       
  290       /**
  291        * Inserts and returns a new empty value (as xml) as the ith "phone" element
  292        */
  293       public org.apache.xmlbeans.samples.xquery.employees.PhoneType insertNewPhone(int i)
  294       {
  295           synchronized (monitor())
  296           {
  297               check_orphaned();
  298               org.apache.xmlbeans.samples.xquery.employees.PhoneType target = null;
  299               target = (org.apache.xmlbeans.samples.xquery.employees.PhoneType)get_store().insert_element_user(PHONE$4, i);
  300               return target;
  301           }
  302       }
  303       
  304       /**
  305        * Appends and returns a new empty value (as xml) as the last "phone" element
  306        */
  307       public org.apache.xmlbeans.samples.xquery.employees.PhoneType addNewPhone()
  308       {
  309           synchronized (monitor())
  310           {
  311               check_orphaned();
  312               org.apache.xmlbeans.samples.xquery.employees.PhoneType target = null;
  313               target = (org.apache.xmlbeans.samples.xquery.employees.PhoneType)get_store().add_element_user(PHONE$4);
  314               return target;
  315           }
  316       }
  317       
  318       /**
  319        * Removes the ith "phone" element
  320        */
  321       public void removePhone(int i)
  322       {
  323           synchronized (monitor())
  324           {
  325               check_orphaned();
  326               get_store().remove_element(PHONE$4, i);
  327           }
  328       }
  329   }

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