16.10.2015 Views

Getting Startedwith pureQuery

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 11 – Annotated-Method Programming Style 213<br />

types of options files: genProps and bindProps. The Generator utility uses genProps<br />

files.<br />

An options file is a text file that lists interfaces and <strong>pureQuery</strong>Xml files to be processed,<br />

and the options to apply to each interface or file. Each interface and <strong>pureQuery</strong>Xml file<br />

must be listed on a separate line in the options file, followed by an equal sign (=), and then<br />

any options that <strong>pureQuery</strong> should use when it processes that item. Additionally, in each<br />

options file, you can provide default options on a line that starts with defaultOptions.<br />

<strong>pureQuery</strong> uses each option that you specify on the defaultOptions line for all the<br />

items, except for those items where the option is specified with a different value. Listing<br />

11.6 shows an example of how you would provide default options and interfaces in an<br />

options file.<br />

defaultOptions = <br />

myPackage1.MyInterface1 = <br />

myPackage2.MyInterface2 = <br />

Listing 11.6 - Example of listing default options and interfaces in an options file<br />

11.3.1.1 Specifying option files in Optim Development Studio<br />

IBM Optim Development Studio automatically runs the Generator utility for the interfaces in<br />

<strong>pureQuery</strong>-enabled projects when you build them. <strong>pureQuery</strong>-enabled projects in IBM<br />

Optim Development Studio contain a folder named <strong>pureQuery</strong>Folder. The folder<br />

contains two options files: one named Default.genProps, and one named<br />

Default.bindProps. Notice the file Default.genProps in Figure 11.3. If you want to<br />

specify options for the any of the interface in your project, list those interfaces in<br />

Default.genProps, along with the options that you want. When there are interfaces in<br />

your project that are not in Default.genProps, Optim Development Studio still<br />

generates implementation classes for them, using default settings.<br />

Figure 11.3 - The options file Default.genProps in a <strong>pureQuery</strong>-enabled project<br />

Through menu options and content assist, Optim Development Studio can help you to<br />

create options files. It can help you to add your interfaces and <strong>pureQuery</strong>Xml files to your

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!