BlockFor (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.taskdefs.optional.testing, class: BlockFor

Package org.apache.tools.ant.taskdefs.optional.testing

# Class BlockFor

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.taskdefs.condition.ConditionBase
org.apache.tools.ant.taskdefs.WaitFor
org.apache.tools.ant.taskdefs.optional.testing.BlockFor

All Implemented Interfaces:
  `Cloneable`

public class BlockFor extends WaitFor

Since:
  Ant 1.8

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.tools.ant.taskdefs.WaitFor

  `WaitFor.Unit`

- ## Field Summary

  ### Fields inherited from class org.apache.tools.ant.taskdefs.WaitFor

  `DEFAULT_CHECK_MILLIS, DEFAULT_MAX_WAIT_MILLIS, ONE_DAY, ONE_HOUR, ONE_MILLISECOND, ONE_MINUTE, ONE_SECOND, ONE_WEEK`

  ### Fields inherited from class org.apache.tools.ant.ProjectComponent

  `description, location, project`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BlockFor()`
  Constructor that takes the name of the task in the task name.
  `BlockFor(String taskName)`
  Constructor that takes the name of the task in the task name.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addText(String message)`
  Set the error text; all properties are expanded in the message.
  `protected void`
  `processTimeout()`
  If the wait fails, a BuildException is thrown.

  ### Methods inherited from class org.apache.tools.ant.taskdefs.WaitFor

  `calculateCheckEveryMillis, calculateMaxWaitMillis, execute, processSuccess, setCheckEvery, setCheckEveryUnit, setMaxWait, setMaxWaitUnit, setTimeoutProperty`

  ### Methods inherited from class org.apache.tools.ant.taskdefs.condition.ConditionBase

  `add, addAnd, addAvailable, addChecksum, addContains, addEquals, addFilesMatch, addHttp, addIsFalse, addIsFileSelected, addIsReference, addIsSet, addIsTrue, addNot, addOr, addOs, addSocket, addUptodate, countConditions, getConditions, getTaskName, setTaskName`

  ### Methods inherited from class org.apache.tools.ant.ProjectComponent

  `clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject`

  ### Methods inherited from class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### BlockFor

    public BlockFor()
    Constructor that takes the name of the task in the task name.

  - ### BlockFor

    public BlockFor(String taskName)
    Constructor that takes the name of the task in the task name.
    Parameters:
      `taskName` - the name of the task.

- ## Method Details

  - ### processTimeout

    protected void processTimeout() throws BuildTimeoutException
    If the wait fails, a BuildException is thrown. All the superclasses actions are called first.
    Overrides:
      `processTimeout` in class `WaitFor`
    Throws:
      `BuildTimeoutException` - on timeout, using the text in `text`

  - ### addText

    public void addText(String message)
    Set the error text; all properties are expanded in the message.
    Parameters:
      `message` - the text to use in a failure message