<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Ant-contrib Tasks: Switch
</title>
</head>
<body>
<h1>Switch
</h1>
<p>Task definition for the ANT task to switch on a particular value.
</p>
<h2>Parameters
</h2>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<th>Attribute
</th>
<th>Description
</th>
<th>Required
</th>
</tr>
<tr>
<td valign="top">value
</td>
<td valign="top">The value to switch on.
</td>
<td align="center" valign="top">Yes.
</td>
</tr>
<tr>
<td valign="top">caseinsensitive
</td>
<td valign="top">Should we do case insensitive comparisons?
</td>
<td align="center" valign="top">No, default is
"false
"</td>
</tr>
</table>
<h2>Parameters specified as nested elements
</h2>
<p>At least one
<code><case
></code> or
<code><default
></code> is required.
</p>
<h3>case
</h3>
<p>An individual case to consider, if the value that is being
switched on matches to value attribute of the case, then the
nested tasks will be executed.
</p>
<h4>Parameters
</h4>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<th>Attribute
</th>
<th>Description
</th>
<th>Required
</th>
</tr>
<tr>
<td valign="top">value
</td>
<td valign="top">The value to match against the tasks value attribute.
</td>
<td align="center" valign="top">Yes.
</td>
</tr>
</table>
<h3>default
</h3>
<p>The default case for when no match is found. Must not appear
more than once per task.
</p>
<h2>Example
</h2>
<pre>
<switch value=
"${foo}
">
<case value=
"bar
">
<echo message=
"The value of property foo is bar
" /
>
</case
>
<case value=
"baz
">
<echo message=
"The value of property foo is baz
" /
>
</case
>
<default
>
<echo message=
"The value of property foo is not sensible
" /
>
</default
>
</switch
>
</pre>
<hr>
<p align="center">Copyright
© 2002 Ant-Contrib Project. All
rights Reserved.
</p>
</body>
</html>