<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_09) on Thu Nov 02 11:46:41 EST 2006 -->
<TITLE>
Switch (Ant Contrib)
</TITLE>
<META NAME="keywords" CONTENT="net.sf.antcontrib.logic.Switch class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="Switch (Ant Contrib)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package
</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class
</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help
</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../net/sf/antcontrib/logic/RunTargetTask.html" title="class in net.sf.antcontrib.logic"><B>PREV CLASS
</B></A>
<A HREF="../../../../net/sf/antcontrib/logic/Switch.Case.html" title="class in net.sf.antcontrib.logic"><B>NEXT CLASS
</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?net/sf/antcontrib/logic/Switch.html" target="_top"><B>FRAMES
</B></A>
<A HREF="Switch.html" target="_top"><B>NO FRAMES
</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes
</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:
<A HREF="#nested_class_summary">NESTED
</A> |
<A HREF="#fields_inherited_from_class_org.apache.tools.ant.Task">FIELD
</A> |
<A HREF="#constructor_summary">CONSTR
</A> |
<A HREF="#method_summary">METHOD
</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:
FIELD
|
<A HREF="#constructor_detail">CONSTR
</A> |
<A HREF="#method_detail">METHOD
</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
net.sf.antcontrib.logic
</FONT>
<BR>
Class Switch
</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by ">org.apache.tools.ant.ProjectComponent
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by ">org.apache.tools.ant.Task
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>net.sf.antcontrib.logic.Switch
</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class
<B>Switch
</B><DT>extends org.apache.tools.ant.Task
</DL>
</PRE>
<P>
Task definition for the ANT task to switch on a particular value.
<pre>
Usage:
Task declaration in the project:
<code>
<taskdef name="switch" classname="net.sf.antcontrib.logic.Switch" /
>
</code>
Task calling syntax:
<code>
<switch value="value" [caseinsensitive="true|false"]
>
<case value="val"
>
<property name="propname" value="propvalue" /
> |
<antcall target="targetname" /
> |
any other tasks
</case
>
[
<default
>
<property name="propname" value="propvalue" /
> |
<antcall target="targetname" /
> |
any other tasks
</default
>
]
</switch
>
</code>
Attributes:
value -
> The value to switch on
caseinsensitive -
> Should we do case insensitive comparisons?
(default is false)
Subitems:
case --
> 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.
default --
> The default case for when no match is found.
Crude Example:
<code>
<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
>
</code>
</pre>
<P>
<P>
<DL>
<DT><B>Author:
</B></DT>
<DD><a href="mailto:mattinger@yahoo.com">Matthew Inger
</a>,
<a href="mailto:stefan.bodewig@freenet.de">Stefan Bodewig
</a></DD>
</DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary
</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../net/sf/antcontrib/logic/Switch.Case.html" title="class in net.sf.antcontrib.logic">Switch.Case
</A></B></CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary
</B></FONT></TH>
</TR>
</TABLE>
<A NAME="fields_inherited_from_class_org.apache.tools.ant.Task"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Fields inherited from class org.apache.tools.ant.Task
</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>description, location, target, taskName, taskType, wrapper
</CODE></TD>
</TR>
</TABLE>
<A NAME="fields_inherited_from_class_org.apache.tools.ant.ProjectComponent"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Fields inherited from class org.apache.tools.ant.ProjectComponent
</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>project
</CODE></TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary
</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../net/sf/antcontrib/logic/Switch.html#Switch()">Switch
</A></B>()
</CODE>
<BR>
Default Constructor
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary
</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../net/sf/antcontrib/logic/Switch.html#addDefault(org.apache.tools.ant.taskdefs.Sequential)">addDefault
</A></B>(org.apache.tools.ant.taskdefs.Sequential
res)
</CODE>
<BR>
Creates the
<default
> tag
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../net/sf/antcontrib/logic/Switch.Case.html" title="class in net.sf.antcontrib.logic">Switch.Case
</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../net/sf/antcontrib/logic/Switch.html#createCase()">createCase
</A></B>()
</CODE>
<BR>
Creates the
<case
> tag
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../net/sf/antcontrib/logic/Switch.html#execute()">execute
</A></B>()
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../net/sf/antcontrib/logic/Switch.html#setCaseInsensitive(boolean)">setCaseInsensitive
</A></B>(boolean
c)
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../net/sf/antcontrib/logic/Switch.html#setValue(java.lang.String)">setValue
</A></B>(java.lang.String
value)
</CODE>
<BR>
Sets the value being switched on
</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_org.apache.tools.ant.Task"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class org.apache.tools.ant.Task
</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
</CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_org.apache.tools.ant.ProjectComponent"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class org.apache.tools.ant.ProjectComponent
</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>getProject, setProject
</CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object
</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail
</B></FONT></TH>
</TR>
</TABLE>
<A NAME="Switch()"><!-- --></A><H3>
Switch
</H3>
<PRE>
public
<B>Switch
</B>()
</PRE>
<DL>
<DD>Default Constructor
<P>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail
</B></FONT></TH>
</TR>
</TABLE>
<A NAME="execute()"><!-- --></A><H3>
execute
</H3>
<PRE>
public void
<B>execute
</B>()
throws org.apache.tools.ant.BuildException
</PRE>
<DL>
<DD><DL>
<DT><B>Overrides:
</B><DD><CODE>execute
</CODE> in class
<CODE>org.apache.tools.ant.Task
</CODE></DL>
</DD>
<DD><DL>
<DT><B>Throws:
</B>
<DD><CODE>org.apache.tools.ant.BuildException
</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="setValue(java.lang.String)"><!-- --></A><H3>
setValue
</H3>
<PRE>
public void
<B>setValue
</B>(java.lang.String
value)
</PRE>
<DL>
<DD>Sets the value being switched on
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setCaseInsensitive(boolean)"><!-- --></A><H3>
setCaseInsensitive
</H3>
<PRE>
public void
<B>setCaseInsensitive
</B>(boolean
c)
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="createCase()"><!-- --></A><H3>
createCase
</H3>
<PRE>
public
<A HREF="../../../../net/sf/antcontrib/logic/Switch.Case.html" title="class in net.sf.antcontrib.logic">Switch.Case
</A> <B>createCase
</B>()
throws org.apache.tools.ant.BuildException
</PRE>
<DL>
<DD>Creates the
<case
> tag
<P>
<DD><DL>
<DT><B>Throws:
</B>
<DD><CODE>org.apache.tools.ant.BuildException
</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="addDefault(org.apache.tools.ant.taskdefs.Sequential)"><!-- --></A><H3>
addDefault
</H3>
<PRE>
public void
<B>addDefault
</B>(org.apache.tools.ant.taskdefs.Sequential
res)
throws org.apache.tools.ant.BuildException
</PRE>
<DL>
<DD>Creates the
<default
> tag
<P>
<DD><DL>
<DT><B>Throws:
</B>
<DD><CODE>org.apache.tools.ant.BuildException
</CODE></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package
</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class
</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help
</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../net/sf/antcontrib/logic/RunTargetTask.html" title="class in net.sf.antcontrib.logic"><B>PREV CLASS
</B></A>
<A HREF="../../../../net/sf/antcontrib/logic/Switch.Case.html" title="class in net.sf.antcontrib.logic"><B>NEXT CLASS
</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?net/sf/antcontrib/logic/Switch.html" target="_top"><B>FRAMES
</B></A>
<A HREF="Switch.html" target="_top"><B>NO FRAMES
</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes
</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:
<A HREF="#nested_class_summary">NESTED
</A> |
<A HREF="#fields_inherited_from_class_org.apache.tools.ant.Task">FIELD
</A> |
<A HREF="#constructor_summary">CONSTR
</A> |
<A HREF="#method_summary">METHOD
</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:
FIELD
|
<A HREF="#constructor_detail">CONSTR
</A> |
<A HREF="#method_detail">METHOD
</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>