Class SwitchTask

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class SwitchTask
    extends org.apache.tools.ant.Task
    This task emulates a Java switch.
    • Field Summary

      • Fields inherited from class org.apache.tools.ant.Task

        target, taskName, taskType, wrapper
      • Fields inherited from class org.apache.tools.ant.ProjectComponent

        description, location, project
    • Constructor Summary

      Constructors 
      Constructor Description
      SwitchTask()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addCase​(Case c)
      Adds a case to this switch.
      void addDefault​(DefaultCase c)
      Adds a default case to this switch.
      void execute()  
      void init()
      Register dependent tasks.
      void setName​(java.lang.String name)
      Set the name of the property to switch on.
      • Methods inherited from class org.apache.tools.ant.Task

        bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
      • Methods inherited from class org.apache.tools.ant.ProjectComponent

        clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SwitchTask

        public SwitchTask()
    • Method Detail

      • init

        public void init()
        Register dependent tasks.
        Overrides:
        init in class org.apache.tools.ant.Task
      • setName

        public void setName​(java.lang.String name)
        Set the name of the property to switch on.
        Parameters:
        name - the name of the property to switch on.
      • addCase

        public void addCase​(Case c)
        Adds a case to this switch. A switch can have any number of cases.
        Parameters:
        c - the case to add.
      • addDefault

        public void addDefault​(DefaultCase c)
        Adds a default case to this switch. Only one case may be added.
        Parameters:
        c - the default case.
      • execute

        public void execute()
                     throws org.apache.tools.ant.BuildException
        Overrides:
        execute in class org.apache.tools.ant.Task
        Throws:
        org.apache.tools.ant.BuildException