terp - the ANT Tasks

Class Fail

  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by com.codemesh.terp.ant.TerpAwareTask
              extended by com.codemesh.terp.ant.Fail
All Implemented Interfaces:
TerpAware, TerpContextHolder, java.lang.Cloneable

public class Fail
extends TerpAwareTask

A fail replacement that simplifies unit-testing of ANT tasks by supporting terp if and unless conditions .

Nested Class Summary
Nested classes/interfaces inherited from interface com.codemesh.terp.ant.TerpAware
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
Fail(org.apache.tools.ant.Project p)
Method Summary
 void execute()
 void setMessage(java.lang.String message)
          Set the message to display in the case of failure.
 void setMessageExpression(java.lang.String message)
          Set an expression to be evaluated (not expanded) and used as the failure message.
Methods inherited from class com.codemesh.terp.ant.TerpAwareTask
getContext, getIf, getUnless, satisfiesConditions, setContext, setIf, setProject, setUnless
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, 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
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public Fail(org.apache.tools.ant.Project p)


public Fail()
Method Detail


public void setMessage(java.lang.String message)
Set the message to display in the case of failure. The message may be a template string containing variables that are going to be expanded in the current project's context.

message - the failure message.
See Also:
the attribute value is interpreted as a terp expression to be evaluated rather than a template string to be expanded.


public void setMessageExpression(java.lang.String message)
Set an expression to be evaluated (not expanded) and used as the failure message. For example, the expression 3*4 would result in the display of the string "12" in the case of failure. This option is very useful for the display of process invocation output based on a result variable.

message - the terp expression.
See Also:
the attribute value is interpreted as a template string to be expanded rather than a terp expression to be evaluated.


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

terp - the ANT Tasks

Copyright © 2008-2016 by Codemesh, Inc. All Rights Reserved.