<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<model>
  <id>thing</id>
  <name>Thing</name>
  <defaults>
    <default>
      <key>package</key>
      <value>test</value>
    </default>
  </defaults>
  <classes>
    <class java.clone="deep">
      <!-- test inheritance of clone mode -->
      <name>SuperThing</name>
      <version>1.0.0</version>
    </class>
    <class rootElement="true" java.clone.hook="cloneCustomFields">
      <name>Thing</name>
      <superClass>SuperThing</superClass>
      <version>1.0.0</version>
      <fields>
        <!-- various simple types -->
        <field>
          <name>someBoolean</name>
          <version>1.0.0</version>
          <type>boolean</type>
        </field>
        <field>
          <name>someChar</name>
          <version>1.0.0</version>
          <type>char</type>
        </field>
        <field>
          <name>someByte</name>
          <version>1.0.0</version>
          <type>byte</type>
        </field>
        <field>
          <name>someShort</name>
          <version>1.0.0</version>
          <type>short</type>
        </field>
        <field>
          <name>someInt</name>
          <version>1.0.0</version>
          <type>int</type>
        </field>
        <field>
          <name>someLong</name>
          <version>1.0.0</version>
          <type>long</type>
        </field>
        <field>
          <name>someFloat</name>
          <version>1.0.0</version>
          <type>float</type>
        </field>
        <field>
          <name>someDouble</name>
          <version>1.0.0</version>
          <type>double</type>
        </field>
        <field>
          <name>someString</name>
          <version>1.0.0</version>
          <type>String</type>
        </field>
        <field>
          <name>someDate</name>
          <version>1.0.0</version>
          <type>Date</type>
        </field>
        <field>
          <name>someDom</name>
          <version>1.0.0</version>
          <type>DOM</type>
        </field>
        <!-- associations to simple types -->
        <field>
          <name>someProperties</name>
          <version>1.0.0</version>
          <type>Properties</type>
          <association xml.mapStyle="inline">
            <type>String</type>
            <multiplicity>*</multiplicity>
          </association>
        </field>
        <field>
          <name>someStringList</name>
          <version>1.0.0</version>
          <type>List</type>
          <association>
            <type>String</type>
            <multiplicity>*</multiplicity>
          </association>
        </field>
        <field>
          <name>someStringSet</name>
          <version>1.0.0</version>
          <type>Set</type>
          <association>
            <type>String</type>
            <multiplicity>*</multiplicity>
          </association>
        </field>
        <!-- associations to complex types with deep clone (as per class clone mode) -->
        <field>
          <name>deepThingy</name>
          <version>1.0.0</version>
          <association>
            <type>Thingy</type>
            <multiplicity>1</multiplicity>
          </association>
        </field>
        <field>
          <name>deepThingyList</name>
          <version>1.0.0</version>
          <type>List</type>
          <association>
            <type>Thingy</type>
            <multiplicity>*</multiplicity>
          </association>
        </field>
        <field>
          <name>deepThingySet</name>
          <version>1.0.0</version>
          <type>Set</type>
          <association>
            <type>Thingy</type>
            <multiplicity>*</multiplicity>
          </association>
        </field>
        <!-- associations to complex types with shallow clone (as per override of clone mode) -->
        <field>
          <name>shallowThingy</name>
          <version>1.0.0</version>
          <association java.clone="shallow">
            <type>Thingy</type>
            <multiplicity>1</multiplicity>
          </association>
        </field>
        <field>
          <name>shallowThingyList</name>
          <version>1.0.0</version>
          <type>List</type>
          <association java.clone="shallow">
            <type>Thingy</type>
            <multiplicity>*</multiplicity>
          </association>
        </field>
        <field>
          <name>shallowThingySet</name>
          <version>1.0.0</version>
          <type>Set</type>
          <association java.clone="shallow">
            <type>Thingy</type>
            <multiplicity>*</multiplicity>
          </association>
        </field>
      </fields>
      <codeSegments>
        <codeSegment>
          <version>1.0.0</version>
          <code><![CDATA[
    public java.util.Properties customProperties = new java.util.Properties();

    private void cloneCustomFields( Thing copy )
    {
        if ( this.customProperties != null )
        {
            copy.customProperties = (java.util.Properties) this.customProperties.clone();
        }
    }          
            ]]>
          </code>
        </codeSegment>
      </codeSegments>
    </class>
    <class java.clone.hook="false">
      <name>Thingy</name>
      <superClass>SuperThing</superClass>
      <version>1.0.0</version>
    </class>
  </classes>
</model>
