Keys and Mode

The following shows how to request the isAmmo mode in the pom.xml

```xml
 <execution>
    <id>generate-android-source-beta-files</id>
    <phase>generate-sources</phase>
    <goals>
         <goal>generate</goal>
    </goals>
    <configuration>
    <mode><isAmmo/></mode>
              <templateFile>template/src/main/java/sponsor/provider/ContractProvider.stg</templateFile>
     <artifactCoords>edu.vanderbilt.isis.druid:druid-template:2.0.0</artifactCoords>
      <contractFile>${basedir}/../contract/incident.xml</contractFile>
      <baseOutputDirectory>${basedir}/target/generated-sources/druid</baseOutputDirectory>
    </configuration>
 </execution>
```

The following shows how the isAmmo is trapped in the template.

```java
BODY(contract) ::= <<
// ST:BODY:start

<if(contract.mode.isAmmo)>
// this comment appears if ammo is enabled
<else>
// this comment appears if ammo is disabled
<endif>
```

The keys work in a similar manner but are specified in the contract.
```xml
  <relation name="media">
 
     <field type="TEXT" name="event id" default="">
        Points to the event to which this belongs.
     </field>

     <key name="update">
        <field ref="event id"/>
     </key>
  </relation>
```

Which might be called out in the template as...

```java
BODY(contract) ::= <<
...
<contract.relations : { rel | <fooTemplate(rel)> }
...
>>

fooTemplate(rel) ::= <<
<if(rel.keyMap.update)>
// this comment appears if the update key is present
<else>
// this comment appears if the update key is missing
<endif>
>>
```

Modes are also allowed in the contract under the document root and relation elements.