| “Strategies in (*)ability” | [iDareMedia] [JWare] [PET] [CI-Dashboard] |
The condition value uris let you perform simple boolean tests without having to create independent <condition> or <criteria> objects. This is a small set of uris where the test is defined by the uri’s scheme name which must match one of the AntX builtin conditions. These short hand conditions are most useful as tests for optionally executed tasksets like <do> and <domatch>. You must explicitly install this uri’s handler; read the Examples section to see how this is done.
The general form of the URI is: $condition:sourcevalue[?options] where condition is one of the predefined short hand conditions like “isdirectory” and sourcevalue is the value against which the condition is applied. Exactly what options are available depends on the short hand condition being used; see each condition’s javadocs for details. Below is a partial listing of the predefined condition schemes with examples; please see the valueuris.xml file for a complete listing and each handler’s javadocs for options.
| Scheme | Example Usage |
| $isdefined: | |
| $istype: | |
| $noneset: | |
| $anyset: | |
| $notwhitespace: | |
| $filenotempty: | |
| $iszero: | |
| $not: | |
| $issettrue: |
1) The following snippet declares the default scheme names for the short hand condition uri handlers. The snippet has been abbreviated for space considerations. This is usually done by an “init” target or at the project’s top level.
<manageuris action="install">
<parameter name="isset"
value="com.idaremedia.antx.condition.ShortHandValueURIHandler"/>
<parameter name="allset"
value="com.idaremedia.antx.condition.ShortHandValueURIHandler"/>
...
<parameter name="zero"
value="com.idaremedia.antx.valueuri.condition.ZeroCheckValueURIHandler"/>
</manageuris>
2) The following macrodef snippet uses two short hand condition uris to determine if a failproperty should be set or not.
<do true="${$isdefined:@{failproperty}}">
<do false="${$var:_errorcount|$iszero:}">
<copyproperty name="@{failproperty}" var="_errorcount"/>
</do>
</do>