<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jaxb:bindings
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
    jaxb:extensionBindingPrefixes="xjc"
    version="2.1"
    schemaLocation="configurationService.xsd">
    <jaxb:globalBindings fixedAttributeAsConstantProperty="true" generateIsSetMethod="false"
                         choiceContentProperty="false">
      <!-- Every generated class should be serializable -->
      <xjc:serializable uid="1"/>
      <!-- xjc:simple generates distinct fields for each xsd:choice element. -->
      <xjc:simple/>
    </jaxb:globalBindings>

    <!-- Rename the "top-level" configurations to a more intuitive name. -->
    <jaxb:bindings node="xs:element[@name='cache']">
      <jaxb:class name="CacheConfig"/>
    </jaxb:bindings>
    <jaxb:bindings node="xs:complexType[@name='region-type']">
      <jaxb:class name="RegionConfig"/>
    </jaxb:bindings>

    <!-- The automatic plural naming turns "gateway" into "gatewaies."  Workaround. -->
    <jaxb:bindings node="xs:element[@name='cache']//xs:element[@name='gateway-hub']//xs:element[@name='gateway']">
      <jaxb:property name="gateways"/>
    </jaxb:bindings>

    <!-- Rename JNDI configuration elements to be less unwieldy. -->
    <jaxb:bindings node="xs:complexType[@name='jndi-bindings-type']//xs:element[@name='config-property']//xs:element[@name='config-property-name']">
      <jaxb:property name="name"/>
    </jaxb:bindings>
    <jaxb:bindings node="xs:complexType[@name='jndi-bindings-type']//xs:element[@name='config-property']//xs:element[@name='config-property-type']">
      <jaxb:property name="type"/>
    </jaxb:bindings>
    <jaxb:bindings node="xs:complexType[@name='jndi-bindings-type']//xs:element[@name='config-property']//xs:element[@name='config-property-value']">
      <jaxb:property name="value"/>
    </jaxb:bindings>

    <!-- Rename the custom elements and ensure their type. -->
    <jaxb:bindings node="//xs:element[@name='cache']/xs:complexType/xs:sequence/xs:any">
        <jaxb:property name="customCacheElements">
            <jaxb:baseType name="org.apache.geode.cache.configuration.CacheElement"/>
        </jaxb:property>
    </jaxb:bindings>
    <jaxb:bindings node="xs:complexType[@name='region-type']/xs:sequence/xs:any">
      <jaxb:property name="customRegionElements">
        <jaxb:baseType name="org.apache.geode.cache.configuration.CacheElement"/>
      </jaxb:property>
    </jaxb:bindings>

    <!-- Integer values should be Integer types, despite being defined as xsd:string -->
    <!--<jaxb:bindings node="//xs:attribute[@name='port']" multiple="true">-->
      <!--<jaxb:property name="port">-->
        <!--<jaxb:baseType name="Integer"/>-->
      <!--</jaxb:property>-->
    <!--</jaxb:bindings>-->
    <!--<jaxb:bindings node="//xs:attribute[@name='start-port']" multiple="true">-->
      <!--<jaxb:property name="startPort">-->
        <!--<jaxb:baseType name="Integer"/>-->
      <!--</jaxb:property>-->
    <!--</jaxb:bindings>-->
    <!--<jaxb:bindings node="//xs:attribute[@name='end-port']" multiple="true">-->
      <!--<jaxb:property name="endPort">-->
        <!--<jaxb:baseType name="Integer"/>-->
      <!--</jaxb:property>-->
    <!--</jaxb:bindings>-->

    <!-- We prefer to not generate the ClientCache class, as it would be unused.
         Direct it to refer to a nonexistent "predefined" class. -->
    <jaxb:bindings node="xs:element[@name='client-cache']">
      <jaxb:class ref="nonexistent.IgnoredClass"/>
    </jaxb:bindings>

    <!-- The @Experimental annotation and license header must be added manually.
         For additional adjustments made not within this file, see the comments near the top of
         the configurationService.xsd. -->
</jaxb:bindings>
