mawalker/druid — pull request #18 by phreed (2013-02-15 21:52:11+00:00)
Title: Keys and Mode

The following shows how to request the isAmmo mode in the pom.xml

```xml

generate-android-source-beta-files
generate-sources

generate

template/src/main/java/sponsor/provider/ContractProvider.stg
edu.vanderbilt.isis.druid:druid-template:2.0.0
${basedir}/../contract/incident.xml
${basedir}/target/generated-sources/druid

```

The following shows how the isAmmo is trapped in the template.

```java
BODY(contract) ::= <<
// ST:BODY:start

// this comment appears if ammo is enabled

// this comment appears if ammo is disabled

```

The keys work in a similar manner but are specified in the contract.
```xml

Points to the event to which this belongs.

```

Which might be called out in the template as...

```java
BODY(contract) ::= <<
...
}
...
>>

fooTemplate(rel) ::= <<

// this comment appears if the update key is present

// this comment appears if the update key is missing

>>
```

Modes are also allowed in the contract under the document root and relation elements.